sk8ter87
Member level 3
Hi guyz,
i'm now working on a website that interacts with vb then it will allow to control hardware through ms comm.
The flow will be like this:
web -> vb ->hardware.
I'm using using mysql as a bridge between Web and vb
The part from web to vb working fine..
my problem is now to control the hardware from vb..
Can anyone tell me how to pass the data from mysql to mscomm?
Hope you guyz will help me..
The vb file is uploaded below..
i'm now working on a website that interacts with vb then it will allow to control hardware through ms comm.
The flow will be like this:
web -> vb ->hardware.
I'm using using mysql as a bridge between Web and vb
The part from web to vb working fine..
my problem is now to control the hardware from vb..
Can anyone tell me how to pass the data from mysql to mscomm?
Hope you guyz will help me..
Code:
Public up, down, lleft, right As Boolean 'to keep track of which buttons are already pressed
Public cn As New ADODB.Connection
Public rs As New ADODB.Recordset
Private Sub Form_Load()
cn.ConnectionString = "DRIVER={MySQL ODBC 3.51 Driver};SEVER=localhost;DATABASE=rccontrol;UID=root"
cn.CursorLocation = adUseClient
cn.Open
MSComm1.RThreshold = 1
MSComm1.InputLen = 1
MSComm1.Settings = "9600,N,8,1"
MSComm1.DTREnable = False
MSComm1.CommPort = 1
MSComm1.PortOpen = True
If MSComm1.PortOpen = False Then
'MsgBox "COM " + CStr(MSComm1.CommPort) + " not open"
End If
End Sub
Private Sub MSComm1_OnComm()
Dim Data As String
If MSComm1.CommEvent = comEvReceive Then
Data = MSComm1.Input
End If
End Sub
Private Sub Timer1_Timer()
rs.Open "SELECT * FROM presskey WHERE 1", cn, adOpenStatic, adLockOptimistic
Label6.Caption = rs(0).Value
rs.Close
End Sub
The vb file is uploaded below..
Attachments
Last edited: