VB 6 and mySQL

Discussion in 'Web Design & Coding' started by disavowed00, Jan 14, 2005.

  1. disavowed00

    disavowed00 OSNN One Post Wonder

    Messages:
    7
    I want to connect a mySQL database to a VB program. mySQL is running on my host machine. The problem is that I'm nt sure what to use for the server name in the connection string. I am very new at this (2 days) so I need a little help. I tried using myodbc but it just gives me an error.
    Things I need to know:
    1) What do I use for the server name in the connection string
    2) I did not set up a password for mySQL so what do I use for the user name

    3) If there is an easier way to do this then please tell me.

    Also, I am using ado controls
     
  2. RickyC

    RickyC OSNN Addict

    Messages:
    199
    Location:
    Earth
    1. Server name is the name of the host machine mysql is installed on (computer name).

    2. You need to set a username & password using the mysql admin tool to gain access/set privliges to your database.

    3. This is the simplest way I can think of!
     
  3. Geffy

    Geffy Moderator Folding Team

    Messages:
    7,805
    Location:
    United Kingdom
    as long as mysql is on your localhost machine then you can refer to it as "localhost" if you run mysql.exe (assuming you are on windows) then you need to create a database, switch to it and then create the tables you need
    you will also need to add some users to it. I think there are probably some windows gui applications that you can use to set things like that up.
     
  4. disavowed00

    disavowed00 OSNN One Post Wonder

    Messages:
    7
    I have set priveleges and access. VB still can't find the server on my local machine. I have tried using localhost as the server name and the computer name itself. Niether works!

    Thanks for the help so far, but it still doesn't work.
     
  5. fitz

    fitz Just Floating Along Staff Member Political User Folding Team

    Messages:
    4,076
    Location:
    Chicagoland
  6. disavowed00

    disavowed00 OSNN One Post Wonder

    Messages:
    7
    thanks for the help guys. Turns out the myodbc driver is a piece of junk. I had to download an archived version and now it works.