Я перерыл весь интернет и не нашел, как с помощью MyDac создать базу данных. Подскажите форум использующих ваш продукт.
Когда я переношу свою программу написанную на builder xe на другой компьютер, то там базы нет. Как правильно проверить существует ли база, а в этой базе таблица? и как создать таблицу программно?
How to create database in programm?
in computer where i run program stay mysql5.5
if i run on computer where database is created->ok. Also i can create database using
if database not create on computer, code not work-> erorr. If databasename set"" -> i have erorr 'erorr no database selected' Haw create database on clear mysql using MyDac. Create database special programm don't tell.
Sorry, for my bad Inglish.
if i run on computer where database is created->ok. Also i can create database using
Code: Select all
MyConnection2->ExecSQL("CREATE DATABASE IF NOT EXISTS `u_db` CHARACTER SET utf8 COLLATE utf8_general_ci",NULL,0);Sorry, for my bad Inglish.
To solve the problem you should connect to the Mysql system database before creating database, create new database and after this connect to new database, like this:
Code: Select all
MyConnection2->Database = "mysql";
MyConnection2->Connect();
MyConnection2->ExecSQL("CREATE DATABASE ...");
MyConnection2->Database = "new_database";
MyConnection2->Connect();Thanks.
if in next relise MySql without mysql database? users see erorr
I write:
2 day - work OK.
I'am look other database, have problem too. Fine if you write new VCL component TCreateDatabase
. On new computers when i stay my program, these be easy.
No connection requaid
if in next relise MySql without mysql database? users see erorr
I write:
Code: Select all
try{
Form2->MyConnection2->Database="u_db";
Form2->MyConnection2->Connected=true;
}
catch(...)
{
MyServerControl1->CreateDatabase("u_db",true,"UTF8","DEFAULT");I'am look other database, have problem too. Fine if you write new VCL component TCreateDatabase
Code: Select all
CreateDatabase1->Create("mydatabase",innodb,utf8,default);-
AndreyZ