Results 1 to 7 of 7

Thread: VB6 -> MySQL Connect - old topic new issue

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Mar 2011
    Posts
    20

    Angry 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.

  2. #2
    PowerPoster
    Join Date
    Feb 2012
    Location
    West Virginia
    Posts
    14,206

    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


    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
    Last edited by DataMiser; Aug 19th, 2013 at 10:38 AM.

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Mar 2011
    Posts
    20

    Re: VB6 -> MySQL Connect - old topic new issue

    Quote Originally Posted by DataMiser View Post
    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 View Post
    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 View Post
    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 Originally Posted by DataMiser View Post
    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
    Last edited by klyxmaster; Aug 19th, 2013 at 10:55 AM.

  4. #4

    Thread Starter
    Junior Member
    Join Date
    Mar 2011
    Posts
    20

    Re: VB6 -> MySQL Connect - old topic new issue

    Is there a reference library I am not adding correctly?

  5. #5
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    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)

  6. #6
    PowerPoster
    Join Date
    Feb 2012
    Location
    West Virginia
    Posts
    14,206

    Re: VB6 -> MySQL Connect - old topic new issue

    Did you read the link I posted?
    Driver={MySQL ODBC 5.2w Driver};Server=localhost;Database=myDataBase;
    User=myUsername;Password=myPassword;Option=3;

  7. #7
    PowerPoster Nightwalker83's Avatar
    Join Date
    Dec 2001
    Location
    Adelaide, Australia
    Posts
    13,344

    Re: VB6 -> MySQL Connect - old topic new issue

    See if the attachments here offer a solution.
    when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
    If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu.
    https://get.cryptobrowser.site/30/4111672

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width