[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
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
Re: Creating database on MySQL server using ADO
Quote:
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
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