VB6 -> MySQL Connect - old topic new issue
Hi
Lets see how to do this to cover all angles :-)
-- PROBLEM
[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
Everyone should recognize that error - but before responding - please read further :-). there is a sleight twist to the situation.
-- BASIC CONNECT CODE
PHP Code:
Dim Connection As New ADODB.Connection
Dim RecordSet As New ADODB.RecordSet
Connection.CursorLocation = adUseClient
Connection.ConnectionString = "DRIVER={MySQL ODBC 3.51 Driver};" & "SERVER=localhost;" & " DATABASE=zp_world;" & "User=root;Password=root;OPTION=3"
Connection.Open
--- SYSTEM
- Win 7 x64
- XAMPP (if you do not know what this is, do not reply)
- MySQL v5.1.49 Running (as a service)
--- STEPS ALREADY TAKEN
- Database is MySQL (not MSS SQL or MDF) and populated
- mysql-connector-odbc-5.2.5-win32 downloaded - Same Error*
- mysql-connector-odbc-5.2.5-win64 downloaded - Same Error
- Even tried the mysql-connector-net-6.7.4 (obviously for vb2008+ but never know)
--- REFERENCES ADDED
- Microsoft ActiveX Data Objects 2.8 Library (actually tried them all 2.0, 2.1,2.5,2.6, 2.7 and 6.1)
I cannot find an old project where I did get this to work(i am sure its not deleted as im a packrat, so I do not have a reference), so I know it works with VB6.
I have several PHP/MySQL projects done successfully. I just wanted to see if I can do this via VB6. (I do not like vb2008+ )
Hopefully someone here can tell me it's a really small error LOL - I've read so many forums and they all say the same thing, so hopefully I provided all those suggestions here to show they did not work.
*I want the final app to work on all systems, so tried the 32bit.
Re: VB6 -> MySQL Connect - old topic new issue
So you are using driver 5.2 but you are specifying driver 3.51 in your connection string?
One would think that may be an issue.
Why would you try a 32 bit driver on a 64bit machine when there is a 64 bit driver for it? Logic would hold that the 32 bit driver may not work
http://www.connectionstrings.com/mys...ctor-odbc-5-1/
One would think that you need to use a connection string that is intended for the driver you are actually using
Quote:
XAMPP (if you do not know what this is, do not reply)
disregard what I said as I am not sure what that is but then it likely has nothing to do with the issue of the wrong driver setting
Re: VB6 -> MySQL Connect - old topic new issue
Quote:
Originally Posted by
DataMiser
So you are using driver 5.2 but you are specifying driver 3.51 in your connection string?
One would think that may be an issue
OOPS forgot to mention i did use 5.1.49 in the connect string and it failed as well
Quote:
Originally Posted by
DataMiser
Why would you try a 32 bit driver on a 64bit machine when there is a 64 bit driver for it? Logic would hold that the 32 bit driver may not work
see the footnote. A lot of my compiles I use the 32bit release so it works on all systems, even though I have a 64bit machine.
Edit: VB6 = 32bit anyways.
Quote:
Originally Posted by
DataMiser
Quote:
Originally Posted by
DataMiser
disregard what I said as I am not sure what that is but then it likely has nothing to do with the issue of the wrong driver setting
I put the XAMPP in as a reference, as many many posts I have come across havent a clue what it is, and then proceed to give answers that were not needed as XAMPP fulfilled it (example they start their answer to make sure you have MySQL running, or they tell you how to install MySQL).
it is a bundle for running your own server on a local machine for the web. comes with [A]pache, [M]ySQL, [P]hp, and [P]earl (X means that is is cross-platform). The relation to this post is that a MySQL server is running (A similar software out there very popular called WAMP - w= Windows).
All posts I have read kept referring to a ODBC connector needed. It is assumed you have a MySQL server running. The two are not related. in PHP you do not need it. So back to my original post, I have downloaded various "connectors" to link MySQL server to VB (somehow) in an attempt to get VB6 to talk to it.
PHP Code:
"DRIVER={MySQL ODBC 3.51 Driver};" & "SERVER=localhost;" & " DATABASE=zp_world;" & "User=root;Password=root;OPTION=3"
This is the most popular connect string on the net and why I posted it here - I did not post all the strings I tried. It is NOT uncommon when working with vb6 or any older language to use legacy apps and methods (pascal and qb64 are good examples of this)
changing it to: "DRIVER={MySQL ODBC 5.1.49 Driver};" does not work. because If i am reading it correctly, it wants the ODBC driver version not the MySQL version.
Hope that clears it up.
Anyone else wanna take a stab at it - im stuck :P
Re: VB6 -> MySQL Connect - old topic new issue
Is there a reference library I am not adding correctly?
Re: VB6 -> MySQL Connect - old topic new issue
Thread moved to the 'Database Development' forum (the 'VB6' forum is only meant for questions which don't fit in more specific forums)
Re: VB6 -> MySQL Connect - old topic new issue
Did you read the link I posted?
Quote:
Driver={MySQL ODBC 5.2w Driver};Server=localhost;Database=myDataBase;
User=myUsername;Password=myPassword;Option=3;
Re: VB6 -> MySQL Connect - old topic new issue
See if the attachments here offer a solution.