Connect to system database with .INI file

Connecting Visual Basic 6.0 to MySql Database. Here is how. Install MySql Datasbe on you local machine, configure it well and by using localhost, root, root, Here is the VB6 Connecting to MySql Databse:
  1. Public Function connectionString()
  2.     connectionString = "DRIVER={" & ReadIniValue(App.path & "\Config.ini", "DEFAULT", "DRIVER") & "};" _
  3.                       & "SERVER=" & ReadIniValue(App.path & "\Config.ini", "DEFAULT", "HOST") & ";" _
  4.                       & "DATABASE=" & ReadIniValue(App.path & "\Config.ini", "DEFAULT", "DBNAME") & ";" _
  5.                       & "UID=" & ReadIniValue(App.path & "\Config.ini", "DEFAULT", "UID") & ";" _
  6.                       & "PWD=" & ReadIniValue(App.path & "\Config.ini", "DEFAULT", "PWD") & ";" _
  7.                       & "OPTION=3"
  8. End Function
-as you notice, here in this code I used a config file. If you have any questions on my config file, you can proceed or click here for sample code on creating config.ini. -If you don't want to use any preconfigured file. you can use the traditional way in connecting to mysql, but I highly suggest you to use preconfigured file, just in case if you are connecting to a remote server, where unexpected connection settings will be change. This is just to avoid the redundant changes on your code. So...... lets proceed.... Visit http://www.jackjones2010.blogspot.com for more info.

can u give me, sample on visual basic 2008. it's very important for me. thq b4.

In reply to by Anonymous (not verified)

Sorry to inform you that currently I do not used Visual Basic 2008, I only used Visual Basic 6, and PHP/Javascript on web development. Anyway I have some samples like this in PHP. If you want.

sir kevern010101 can u give us sample program of ur post? thank u so much

Add new comment