Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

vb5 connection to mysql

Status
Not open for further replies.

phishbone

Programmer
Jun 18, 2003
11
CA
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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top