Connecting To A Database


First of all, you need to download MySQL ODBC 3.51 Driver, here is the link for it:

https://dev.mysql.com/downloads/connector/odbc/3.51.html

Then once it has installed, open up VB6 and make a new project, then go to Project - > References, then tick these:

Microsoft ActiveX Data Objects 2.8 Library
Microsoft DAO 3.6 Object Library

Now here is the code: Code:

Set dbMaster = New ADODB.Connection
Set rsProducts = New ADODB.Recordset

dbMaster.ConnectionString = "DRIVER={MySQL ODBC 3.51 Driver};SERVER=localhost;Database=DBNAME;UID=DBUSER;PWD=DBPASS"
dbMaster.Open



Now figure out how to do queries etc.

This isn't my tutorial just thought people would find it usefull!
Craig's Avatar
Author:
Views:
2,573
Rating:
Posted on Friday 6th July 2007 at 03:20 PM
Dean
Dean's Avatar
This was posted along time ago and Craig no longer visits this site.
Posted on Friday 6th July 2007 at 02:10 AM
ShadowMage
ShadowMage's Avatar
i get this but you could tell the queries and all that stuff =/
Posted on Friday 18th May 2007 at 06:21 PM
mrlee992
mrlee992's Avatar
I Dont Get It...