I've been coding in VB6 for a few years now and so all my programs run off a mySQL server on the internet.
This is what my connection string in VB6 looks like:
Code: Select all
Private Sub Open_Database()
Set conn = New ADODB.Connection
With conn
.CursorLocation = adUseClient
.ConnectionString = "DRIVER={MySQL ODBC 3.51 Driver}; SERVER=xx.xxx.xx.x; DATABASE=myDB; UID=UN; PWD=PW; OPTION=3"
.Open
End With
If (conn.state) Then
Else
MsgBox "No connection to Database, nothing will work. Please get in touch with me about this.", vbCritical, ""
End
End Sub
Code: Select all
Private Sub Read_Database(intPatID As Integer)
Dim strSQL As String
Dim rst As ADODB.Recordset
Open_Database
Set rst = New ADODB.Recordset
strSQL = "SELECT * FROM GuestCL WHERE ID = " & intPatID
With rst
.source = strSQL
.ActiveConnection = conn
.CursorType = adOpenDynamic
.LockType = adLockOptimistic
.Open
txtFirstName.Text = !FirstName & ""
txtLastName.Text = !LastName & ""
txtPhone.Text = !Phone & ""
.Close
End With
Set rst = Nothing
End Sub
I’ve used the Mysqlconnection1 and have made a connection to my database.
I just don’t want to drop $150 on a program I really don’t know can do what i ask it too.
I’m using Visual Studio 2005 (VB).
Thank you for your time,
David