Skip_Laughlin
asked on
Best way to communicate data to and from VB6 running Access databases and a mySQL database on the web?
The title pretty much says it. I have a VB6 application that uses Access databases. I now have the need to pass data to and from a mySQL database on a website.
I would need to import selected records (coded into Access through VB6), export new data to the database, and be able to update selected mySql records.
ODBC and all that does not seem to be an option as this app runs on 200+ stand-alone desktops across the US and I dont want to get into all the local modifications that would be necessary. I have also read on this site that VB6, Access, and mysql dont play well together. XML has been suggested to me as the best vehicle to use for the communication.
I've found some solutions on this site for reading and creating XML data, so that is doable. But is it the best way?
What's your advice, experts?
Thanks in advance for any help.
I would need to import selected records (coded into Access through VB6), export new data to the database, and be able to update selected mySql records.
ODBC and all that does not seem to be an option as this app runs on 200+ stand-alone desktops across the US and I dont want to get into all the local modifications that would be necessary. I have also read on this site that VB6, Access, and mysql dont play well together. XML has been suggested to me as the best vehicle to use for the communication.
I've found some solutions on this site for reading and creating XML data, so that is doable. But is it the best way?
What's your advice, experts?
Thanks in advance for any help.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I think I found it in another solution http://www.experts-exchang e.com/Prog ramming/La nguages/Vi sual_Basic /VB_DB/Q_2 0474332.ht ml?sfQuery TermInfo=1 +10+connec t+databas+ mysql+onli n+set
"Well, here's future reference info for those who come upon this question:
You will need the MyODBC ODBC driver and then just use a connection string:
MyODBC: http://www.mysql.com/downloads/api-myodbc-3.51.html
Sample connection code:
Dim conn As ADODB.Connection
Set conn = New ADODB.Connection
Dim rs As ADODB.Recordset
Set rs = New ADODB.Recordset
conn.CursorLocation = adUseClient
conn.ConnectionString = "DRIVER={MySQL ODBC 3.51 Driver};" _
& "SERVER=127.0.0.1;" _
& "DATABASE=test;" _
& "UID=testuser;" _
& "PWD=12345;" _
& "OPTION=" & 1 + 2 + 8 + 32 + 2048 + 16384
conn.Open
rs.Open "SELECT * FROM mytable WHERE 1=0", conn, adOpenStatic, adLockOptimistic
Check www.vbmysql.com for samplecode and articles on the subject."
Looks basically like what you suggested but includes VB statements. Do you concur, LSM?
"Well, here's future reference info for those who come upon this question:
You will need the MyODBC ODBC driver and then just use a connection string:
MyODBC: http://www.mysql.com/downloads/api-myodbc-3.51.html
Sample connection code:
Dim conn As ADODB.Connection
Set conn = New ADODB.Connection
Dim rs As ADODB.Recordset
Set rs = New ADODB.Recordset
conn.CursorLocation = adUseClient
conn.ConnectionString = "DRIVER={MySQL ODBC 3.51 Driver};" _
& "SERVER=127.0.0.1;" _
& "DATABASE=test;" _
& "UID=testuser;" _
& "PWD=12345;" _
& "OPTION=" & 1 + 2 + 8 + 32 + 2048 + 16384
conn.Open
rs.Open "SELECT * FROM mytable WHERE 1=0", conn, adOpenStatic, adLockOptimistic
Check www.vbmysql.com for samplecode and articles on the subject."
Looks basically like what you suggested but includes VB statements. Do you concur, LSM?
Yes, that's the way you connect to a MySQL database.
ASKER