| | |
Commend -Connection for MySQL with VB6
![]() |
•
•
Join Date: Jul 2008
Posts: 44
Reputation:
Solved Threads: 3
Hi,
If you are interest in using MySQL as your back end database, here is one way to connect:
By using ODBC:
'Declare ADODB variable
Public ConnectData As New ADODB.Connection
Set ConnectData = New ADODB.Connection
ConnectData.Open "DSN=MySQL_ODBC"
If you want to use MySQL ODBC 3.51 Driver , You can write the connection like this:
Set ConnectData = New ADODB.Connection
'ConnectData.ConnectionString = "DRIVER={MySQL ODBC 3.51 Driver};SERVER=localhost;Database=Databasename;UID=Username;PWD=Password;OPTION=3"
ConnectData.Open
If you want to use MySQL ODBC 5.1 Driver , You can write the connection like this:
ConnectData.ConnectionString = "DRIVER={MySQL ODBC 5.1 Driver};SERVER=localhost;Database=Databasename;UID=Username;PWD=Password;OPTION=3"
ConnectData.Open
I hope this will be helpful for New learner. If there is another new easy and simpler way, give your sugestion here.
If you are interest in using MySQL as your back end database, here is one way to connect:
By using ODBC:
'Declare ADODB variable
Public ConnectData As New ADODB.Connection
Set ConnectData = New ADODB.Connection
ConnectData.Open "DSN=MySQL_ODBC"
If you want to use MySQL ODBC 3.51 Driver , You can write the connection like this:
Set ConnectData = New ADODB.Connection
'ConnectData.ConnectionString = "DRIVER={MySQL ODBC 3.51 Driver};SERVER=localhost;Database=Databasename;UID=Username;PWD=Password;OPTION=3"
ConnectData.Open
If you want to use MySQL ODBC 5.1 Driver , You can write the connection like this:
ConnectData.ConnectionString = "DRIVER={MySQL ODBC 5.1 Driver};SERVER=localhost;Database=Databasename;UID=Username;PWD=Password;OPTION=3"
ConnectData.Open
I hope this will be helpful for New learner. If there is another new easy and simpler way, give your sugestion here.
![]() |
Other Threads in the Visual Basic 4 / 5 / 6 Forum
- Previous Thread: Solved: VB 4/6 and volume labels
- Next Thread: VB 4/6 and volume labels
| Thread Tools | Search this Thread |
* 6 429 2007 access activex add age application basic beginner birth bmp calculator cd cells.find click client code college component connection connectionproblemusingvb6usingoledb copy creat ctrl+f data database datareport date delete dissertations dissertationthesis dissertationtopic edit error excel excelmacro file filename form hardware header iamthwee image inboxinvb internetfiledownload keypress label listbox listview liveperson login looping machine microsoft movingranges number objectinsert open oracle password prime program prompt range-objects readfile reading record refresh remotesqlserverdatabase report save search sendbyte sites sort sql sql2008 sqlserver subroutine tags textbox time urldownloadtofile vb vb6 vb6.0 vba visual visualbasic visualbasic6 web window windows






