Page 1 of 1

Create a database at runtime

Posted: Sun 25 Jan 2009 17:25
by sergioannis
Hi,
is possible create a database Mysql at runtime with Mydac .
Tenks.
Sergio

Posted: Mon 26 Jan 2009 08:53
by jkuiper
Yes, use TMyScript to put all your queries in it.

Posted: Mon 26 Jan 2009 16:06
by Dimon
To create a database you should use the 'CREATE DATABASE' statement, like this:

Code: Select all

MyConnection.ExecSQL('CREATE DATABASE database_name', []);
After this you can set the Database property to the new database name.