Hi I have no experiance with vb6 and databases, but I do have experiance with mysql and php... I wanna make a game with vb6 and retrieve the user info from my sites database. How do I connect to the database in vb6.
A tutorial would be nice.
Hi I have no experiance with vb6 and databases, but I do have experiance with mysql and php... I wanna make a game with vb6 and retrieve the user info from my sites database. How do I connect to the database in vb6.
A tutorial would be nice.
first download mysql ODBC driver 3.51 and instal it to your machine.
' the connection string
Public Const sqlCon = "DRIVER={MySQL ODBC 3.51 Driver};SERVER=<server address>;DATABASE=<database name>;USER=root;PASSWORD=;OPTION=3"
Dim rs As ADODB.Recordset
Dim adoConn As ADODB.Connection
Set adoConn = New ADODB.Connection
adoConn.ConnectionString = sqlcon
adoConn.Open
Set rs = New ADODB.Recordset
rs.ActiveConnection = adoConn
rs.LockType = adLockOptimistic
rs.CursorLocation = adUseClient
rs.CursorType = adOpenDynamic
sqlstr = "<your query here>"
rs.Open sqlstr
hope it helps.
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.