Hi,
I know there are a lot of posts on this already, but I can't figure out why this won't work. I'm trying to use vb5 to connect to a mysql database. I'm sure that the drivers are installed and the database exists because I tested it using vbscript in an asp page. With the asp page I am able to connect and query the db, but when I try it with the vb5 application, I can't get it to connect. I get this error:
"Data source name not found and no default driver specified".
This is the vb code I'm using
Dim ConnectionSTR As String
Dim conn As ADODB.Connection
Dim Query As String
Dim rs As ADODB.Recordset
Text1.Text = "connecting to database..."
Set conn = New ADODB.Connection
conn.ConnectionString = "DRIVER ={MySQL ODBC 3.51 Driver}; SERVER = localhost; DATABASE = testunits; UID=root; PWD=; OPTION=3"
conn.Open
Text1.Text = "connection succeeded"
Can anyone tell me why this won't work in vb5, but works with vbscript asp?
Thanks,
Emily
I know there are a lot of posts on this already, but I can't figure out why this won't work. I'm trying to use vb5 to connect to a mysql database. I'm sure that the drivers are installed and the database exists because I tested it using vbscript in an asp page. With the asp page I am able to connect and query the db, but when I try it with the vb5 application, I can't get it to connect. I get this error:
"Data source name not found and no default driver specified".
This is the vb code I'm using
Dim ConnectionSTR As String
Dim conn As ADODB.Connection
Dim Query As String
Dim rs As ADODB.Recordset
Text1.Text = "connecting to database..."
Set conn = New ADODB.Connection
conn.ConnectionString = "DRIVER ={MySQL ODBC 3.51 Driver}; SERVER = localhost; DATABASE = testunits; UID=root; PWD=; OPTION=3"
conn.Open
Text1.Text = "connection succeeded"
Can anyone tell me why this won't work in vb5, but works with vbscript asp?
Thanks,
Emily