| | |
Commend -Connection for MySQL with VB6
Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
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
Views: 976 | Replies: 1
| Thread Tools | Search this Thread |
Tag cloud for Visual Basic 4 / 5 / 6
* 6 2007 access activex add age append application basic beginner birth bmp c++ calculator cd cells.find click client code college column 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 listview liveperson login looping machine microsoft movingranges number objectinsert open oracle password prime program prompt range-objects readfile reading record refresh remotesqlserverdatabase report retrieve save search sendbyte sites sort sql sql2008 sqlserver struct subroutine table tags textbox time timer urldownloadtofile vb vb6 vb6.0 vba visual visualbasic visualbasic6 web window windows






