Hi all. i am new to vb 6 world. I am trying to make an .exe application take user input and write it to external mysql database that recides in external server.
I be happy if an expert tell me what connection string should use to connect to mysql database which recides in external or local mysql database?Thanks
part of code that i wrote for connection to access db
I be happy if an expert tell me what connection string should use to connect to mysql database which recides in external or local mysql database?Thanks
part of code that i wrote for connection to access db
Code:
Option Explicit
Private cn As ADODB.Connection 'this is the connection
Private rs As ADODB.Recordset 'this is the recordset
Private Sub Form_Load()
Me.MousePointer = 11 'this makes the mouse pointer the hourglass
[b]
Set cn = New ADODB.Connection 'we've declared it as a ADODB connection lets set it.
cn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source= c:\my documents\DB1.mdb" 'this is the connection string
cn.Open
Set rs = New ADODB.Recordset 'as we did with the connection
[/b]
rs.Open "tbl_master", cn, adOpenKeyset, adLockPessimistic, adCmdTable 'opening the recordset explained in the notes
rs.movefirst 'moves to the first record
Do Until rs.EOF = True 'this is the Loop to add items to the combo box
Combo1.AddItem rs.Fields("field1") 'this adds items from field1 into the combo box
rs.MoveNext 'moves next record
Loop
rs.movefirst
fillfields
Me.MousePointer = 0 'sets the mouse pointer to the normal arrow
End Sub