-
Apr 1st, 2020, 06:18 AM
#1
Thread Starter
Addicted Member
[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
-
Apr 1st, 2020, 09:19 AM
#2
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
-
Apr 1st, 2020, 09:25 AM
#3
Thread Starter
Addicted Member
Re: Creating database on MySQL server using ADO
Originally Posted by Zvoni
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
-
Apr 2nd, 2020, 01:38 AM
#4
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|