Forgot Password / Register
Site Statistics
Total Members: 520
Total Tutorials: 242
Newsest User: 8884244477
Todays Unique Hits: 542
0 Users 7 Guests Online

Connecting To A Database

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

http://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
Author:
Views:
2268
Rating:
Posted on Friday 6th July 2007 at 03:20 PM
Dean
Dean
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
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
I Dont Get It...