I have this code for the MySQL in VB 6
It connects fine and inserts that data on the first run but will not for a second,
Code:
Option Explicit
Dim cnMySql As New rdoConnection
Dim rdoQry As New rdoQuery
Dim rdoRS As rdoResultset
Private Sub Form_Load()
cnMySql.CursorDriver = rdUseOdbc
cnMySql.Connect = "uid=name;pwd=pass;server=server;driver={MySQL ODBC 3.51 Driver};database=DATA;dsn=;"
End Sub
Private Sub Timer1_Timer()
If B(1) = Base(1) Then
B(1) = 0
Text4(1).Text = Text4(1).Text + 1
cnMySql.EstablishConnection
With rdoQry
.Name = "root"
.SQL = "Insert into user (admin,tester,user2,user3,user4) VALUES ('101','202','303','404','505')"
Set .ActiveConnection = cnMySql
Set rdoRS = .OpenResultset(rdOpenKeyset, rdConcurRowVer)
End With
rdoRS.Close
cnMySql.Close
End If
end sub
I want the data to keep entering "Repeating"
Error I get is the .Name
Object is invalid or not set (It is not set in code)