Ask the Expert

Accessing remote MySQL DBs in VB6

I'm looking for a way to access and control remote MySQL DBs in VB6 using either sockets or a free VB control. Do you have any examples of how to manipulate them?

    Requires Free Membership to View

MySQL supports ODBC. Download the ODBC drivers. In your VB project, add the Microsoft Remote Data Object and connect. Your connection code might look something like this:

Dim cnMySql As New rdoConnection
cnMySql.CursorDriver = rdUseOdbc
cnMySql.Connect = "DRIVER={MySQL ODBC 3.51 Driver};" & _
 "SERVER=yourHostName;PORT=3306;" & _
 "DATABASE=dbName;" & _
 "UID=yourUserName;PWD=yourPassword;" & _
Check the values for the OPTION parameter.

This was first published in September 2006

There are Comments. Add yours.

TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to: