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.

i think the connection string is already available here and the rest VB part is same for all databases.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.