Dim myConnection As String = "UID=USERNAME;PWD=password;DATABASE=dbname;WSID=COMPUTER-7A8D3E;APP=Microsoft Data Access Components;SERVER=COMPUTER-7A8D3E"
Private myDBConn As SqlClient.SqlConnection
myDBConn = New SqlClient.SqlConnection(myConnection)
The above is how you would form a connection a database. The myConnection string is can be generated useing "Data Sources (ODBC)" under adminstrative tools in the control panel.
You want the "File DSN" tab, and click add, follow the steps, and when you are done, open the final file in notepad, copy and paste the string, trim it down to what you see above, and you should be good.
To get information out of the database:
'Open a connection
Dim _dt As New DataTable
'Create a command to a stored procedure and add parameters
Dim _cmdInfo As New SqlClient.SqlCommand(StoredProcedureName, myDBConn)
.CommandType = CommandType.StoredProcedure
'Create the dataadapter using our command
Dim _da As New SqlClient.SqlDataAdapter(_cmdStuInfo)
_da.SelectCommand = _cmdStuInfo
'Fill a table
I have an alternative. You may see that when you try to do it with .NET connector or ODBC then it take much time to fetch or insert data. For quick data transection use the following :
ByteFX MySQL Data Transector.
I dont remember URL yet but i have its setup file. So if u need that send me a message with your email. I will send you manually.
The ByteFX Data Connector was purchased by MySQL, and is now offered in the URL I posted above. The current version is much more stable, and they are planning a future version which will have visual deesigners.