Results 1 to 8 of 8

Thread: MySQL + VB?? How Do i??

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Feb 2000
    Posts
    135

    Question

    HI..
    I'm new to MySQL and i want to know if it is possible to have the MySQL database on the same computer as the vb program? When connecting to the database, do u need to know the computer name/ip address? I want to make a connection to the MySQL database called NFHS which would sit in the same path as the VB application. Note: There is no server, no ip address etc (just on the current computer only). How would i connect to a database such as this using ADO?


    Please HELP me!

    Thanks

  2. #2
    Junior Member Cadejos's Avatar
    Join Date
    Dec 2000
    Location
    Costa Rica
    Posts
    29

    Talking Maybe...

    I´ve never worked with MySQL, only with SQL, but maybe it works the same way.... When you install SQL on a local machine (not on a server) the "Server Name" is the same name that you have on the Identification tab in the Network Neighborhood properties.

    If you don´t have the Network Neighborhood Icon on the desktop you can check out your computer name on the windows registry.

    Go to the Run command and type regedit then
    open the folders this way :

    HKEY_LOCAL_MACHINE
    ----System
    --------CurrentControlSet
    ------------Control
    ----------------ComputerName
    --------------------ComputerName (here is the value)


    Don´t change it !!!!!!! I try to and it doesn´t worked !!!

  3. #3
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    You have to have a MySQL server running somewhere in order to access the database. You can run it on the local machine, but you need to have TCP/IP installed -- just use "localhost" or "127.0.0.1" as the server address.

    Anyway, here's some random code if you're interested:
    Attached Files Attached Files
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

  4. #4
    Frenzied Member
    Join Date
    Jan 2001
    Posts
    1,374
    Dear Parksie,

    I downloaded this file and ran it only to get the error message:

    Error &H80004005: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified.

    I am running MYSQL on my pc.

    How do I solve this?

    How do I connect to an external MYSQL server and upload and download data?

  5. #5
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    You need MyODBC from the MySQL website...ooops sorry

    Make sure you get the correct one for NT or 9x.
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

  6. #6
    Frenzied Member
    Join Date
    Jan 2001
    Posts
    1,374
    Dear Parksie,

    Thanks for the mysqltest program. I got it to work OK after installing myODBC.

    Do you know how to access the recordcount property of a recordset retrieved from the server using this code?

    When I use rst.recordcount I get an 'Invalid property value' error.

  7. #7
    PowerPoster Lethal's Avatar
    Join Date
    Oct 2000
    Location
    Ohio
    Posts
    2,496
    Just use a select statement:
    Code:
        Select Count(*) From TableName;

  8. #8
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    You can also use these to get other useful information:
    Code:
    SHOW TABLES; /* return a recordset with a list of tables in the current DB */
    SHOW DATABASES; /* return a recordset with a list of databases on the server */
    USE dbname; /* begin using a different database */
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

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