jd57 Level: Trainee
 Registered: 09-08-2008 Posts: 1
|
storing vb textbox in msaccess table
Hello ! I am a newbie to VB programming.
I am trying to develope a lan interface for unidirectional scientific equipment. Following is my code.
--
Option Explicit
Private Sub form_load()
Winsock1.Close
Winsock1.LocalPort = 2000
Winsock1.Listen
End Sub
Private Sub winsock1_connectionrequest(ByVal requestID As Long)
If Winsock1.State <> sckClosed Then Winsock1.Close
Winsock1.Accept requestID
End Sub
Private Sub winsock1_dataarrival(ByVal bytesTotal As Long)
Dim m_data As String
Winsock1.GetData m_data
Text1 = Text1 & m_data
m_data = vbNullString
Dim mydb As Database
Dim myrs As dao.Recordset
Set mydb = OpenDatabase("F rogram FilesCellConnect_ Abbottcellcounter.mdb")
Set myrs = mydb.OpenRecordset("MainData")
myrs.AddNew
myrs![srl_port] = Text1
myrs.Update
myrs.Close
Text1 = ""
End Sub
--
I have following hitches
1) I get the data as desired in text1 box in display but as soon as it gets transferred in access table it splits up in two at first ETX character in string though it does not do so on subsequent ETX character in following string & adds two recordsets 1st one with firt fragment & 2nd one with second fragment. How can I correct it?
2) How can I keep tcp port in infinite listing mode to accept data whenever sent by equipment ?
Thanks
|