Convert VB6/Access to VB6/Mysql


I am new to VB. I have experience in connecting mysql to PHP.

I have been asked to change an existing application written in VB6(connected to Access databases) to VB6(Connected to mysql database).

Can anyone tell me how to connect VB6 to mysql? Add as much detail as possible.

This is a snippet of the current code I have for VB6(Access).

Private Sub Command1_Click()
full_log_form.Visible = True
main.Visible = False

rs.Open ("SELECT * FROM [table1]"), DataEnvironment1.Connection1, adOpenStatic, adLockOptimistic 'open table1 in connection2
If Not rs.BOF Then
End If
Do Until rs.EOF
temp_string = rs.Fields("Client").Value
list_string = rs.Fields("Client").Value
For i = 0 To (30 - Len(temp_string))
list_string = list_string & " "
Next i
list_string = list_string & rs.Fields("Serial") & vbTab & rs.Fields("Alarm") & vbTab & rs.Fields("DateRec") & vbTab & rs.Fields("Time")
full_log_form.List1.AddItem list_string

'full_log_form.List1.AddItem rs.Fields("client") & vbTab & rs.Fields("Serial") & vbTab & rs.Fields("Alarm") & vbTab & rs.Fields("DateRec") & " " & rs.Fields("Time")
End Sub

Any help would be grately appreciated.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!