VB6 mysql

VB6 have an ability to connect to various databases, even though by default, it uses ms access 97. On of database that supported by vb6 is mysql, the most popular free database server. But before you connect vb6 to mysql, there are several thing you should do. Here they are :

  • First, you must have a vb6 installed and configured properly
  • Then, download mysql server from it’s official site. You can download mysql server for free, since it’s a free open source software. The documentations are available to be downloaded too.
  • Last, you need a connector as a bridge between vb6 and mysql. It’s called mysql connector-odbc 3.51.27(you can use other version as well). You can download this software for free at http://dev.mysql.com/downloads/connector/odbc/3.51.html

How to connect vb6 and mysql

There are several ways to connect vb6 and mysql. But, only one thing that i will explain here, it’s remote data object, or usually, it’s just called RDO. What do you need to do :

  • Add the remote data object to vb6 project, by click project-reference menu
  • check the checkbox Microsoft Remote Data Object 2.0, Microsoft Data Services 2.7 Library
  • Make a simple database on mysql
  • Now we are ready to connect. The connection can be done on form loaded. In other word, we will make an event on form_load.
  • Here’s the code
Dim con As New rdoConnection
Private Sub Form_Load()
con.Connect = "uid=root;pwd=root;server=localhost;
driver={MySQL ODBC 3.51 Driver};database=testdb;"
koneksi.EstablishConnection
End Sub

Incoming search terms for the article:

Related posts:

  1. Visual Basic 6 Introduction
  2. VB6 Ms. Access Data Report
  3. Installing Apache-php-mysql + Webmin on Centos 5
  4. Installing kloxo on Centos 5

Leave a Reply