Results 1 to 4 of 4

Thread: [RESOLVED] Creating database on MySQL server using ADO

  1. #1

    Thread Starter
    Addicted Member beic's Avatar
    Join Date
    Jun 2012
    Posts
    176

    Resolved [RESOLVED] Creating database on MySQL server using ADO

    Hi there,

    I wish to create database on MySQL server using ADO if it doesn't exist.

    Can someone give me some example or any kind of help?

    My current working connection string for test purposes for existing 'test' database is:
    Code:
    DRIVER=MariaDB ODBC 3.1 Driver; SERVER=localhost; PORT=3306; DB=test; UID=root; PWD=test; OPTION=3;
    Thank you for your time and support,

    Kind regards,
    Viktor
    Last edited by beic; Apr 1st, 2020 at 07:07 AM. Reason: typo

  2. #2
    PowerPoster Zvoni's Avatar
    Join Date
    Sep 2012
    Location
    To the moon and then left
    Posts
    4,746

    Re: Creating database on MySQL server using ADO

    Don't connect to a given Database. Connect to Database "mysql" (since it exists on every MySQL-Server, User must have sufficient rights to access it, but you're using root?).
    As for creating a Database: Read the MySQL-Manual how to create a Database
    https://dev.mysql.com/doc/refman/8.0...-database.html
    Last edited by Zvoni; Tomorrow at 31:69 PM.
    ----------------------------------------------------------------------------------------

    One System to rule them all, One Code to find them,
    One IDE to bring them all, and to the Framework bind them,
    in the Land of Redmond, where the Windows lie
    ---------------------------------------------------------------------------------
    People call me crazy because i'm jumping out of perfectly fine airplanes.
    ---------------------------------------------------------------------------------
    Code is like a joke: If you have to explain it, it's bad

  3. #3

    Thread Starter
    Addicted Member beic's Avatar
    Join Date
    Jun 2012
    Posts
    176

    Re: Creating database on MySQL server using ADO

    Quote Originally Posted by Zvoni View Post
    Don't connect to a given Database. Connect to Database "mysql" (since it exists on every MySQL-Server, User must have sufficient rights to access it, but you're using root?).
    As for creating a Database: Read the MySQL-Manual how to create a Database
    https://dev.mysql.com/doc/refman/8.0...-database.html
    I'm using root only for the test purposes, the database server is installed on my local computer.

    I know the query string for creating database, CREATE DATABASE test;

    My issue is that I don't know how to do it from the VB6 code using ADO.

    Kind regards,
    Viktor

  4. #4
    PowerPoster Zvoni's Avatar
    Join Date
    Sep 2012
    Location
    To the moon and then left
    Posts
    4,746

    Re: Creating database on MySQL server using ADO

    Huh? You do know, that the ADO-Connection-Object has an "Execute"-Method?
    https://docs.microsoft.com/en-us/sql...ts-allversions
    Last edited by Zvoni; Tomorrow at 31:69 PM.
    ----------------------------------------------------------------------------------------

    One System to rule them all, One Code to find them,
    One IDE to bring them all, and to the Framework bind them,
    in the Land of Redmond, where the Windows lie
    ---------------------------------------------------------------------------------
    People call me crazy because i'm jumping out of perfectly fine airplanes.
    ---------------------------------------------------------------------------------
    Code is like a joke: If you have to explain it, it's bad

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