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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Connecting via ADO and VB6

Status
Not open for further replies.

LesStockton

Programmer
Mar 29, 2005
20
US
I'm trying to connect to MySQL5 from my VB6 app.
My code for connecting to SQLServer works fine. To MySQL5, it doesn't. It doesn't like the provider, but I'm not sure what's wrong and why.

SQLDB is an ADODB.Connection, by the way.

SQLDB.Provider = Provider ' I've tried "MYSQLPROV" and "MYODBC"
End If

Select Case UCase(Provider)
Case MYSQLDB, MYODBCDB
SQLDB.Properties("Location") = ServerName
SQLDB.Properties("User ID").Value = UserName
SQLDB.Properties("Password").Value = Password
SQLDB.CommandTimeout = 300
SQLDB.Open

It blows up when it hits the open, sometimes, saying something's wrong with the provider. Other times, depending on what I use for Provider, it will blow up at setting the first property, saying that Provider is missing.

I know other people are having success with this, so please let me know how to get it to work.
 
May be an entirely different problem but I had an issue last week where I upgraded to mysql 5. I was trying to connect via Odbc but could not. Anyway on further investigation it turned out that the release of MySQL 5 had a bug. I went back to mysql 4… and all is fine

Age is a consequence of experience
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top