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:
Public Function connectionString() connectionString = "DRIVER={" & ReadIniValue(App.path & "\Config.ini", "DEFAULT", "DRIVER") & "};" _ & "SERVER=" & ReadIniValue(App.path & "\Config.ini", "DEFAULT", "HOST") & ";" _ & "DATABASE=" & ReadIniValue(App.path & "\Config.ini", "DEFAULT", "DBNAME") & ";" _ & "UID=" & ReadIniValue(App.path & "\Config.ini", "DEFAULT", "UID") & ";" _ & "PWD=" & ReadIniValue(App.path & "\Config.ini", "DEFAULT", "PWD") & ";" _ & "OPTION=3" 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.
Comments
This site is very benificial for aspiring prorammers like me.
I'm really impressed to the author for this site and to all the programmer here..keep up the good work..ciao!!
can u give me, sample on
can u give me, sample on visual basic 2008. it's very important for me. thq b4.
Hi!
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.
sample program
sir kevern010101 can u give us sample program of ur post? thank u so much
Pages
Add new comment