View Single Post
  #1 (permalink)  
Old 01-29-10, 11:38 AM
srrupert srrupert is offline
New Member
 
Join Date: Jan 2010
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
MySQL Visual Basic 6 connection

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)

Last edited by digioz; 02-07-10 at 08:51 PM. Reason: Please use code tags
Reply With Quote