Board index » delphi » Create database in runtime

Create database in runtime


2004-11-23 11:04:43 AM
delphi17
Hi all,
I use Interbase, I want my application to create database in runtime,
I see the "create database" sql, but how to execute a query without
connected to
a presented database?
TIA
Turbo Man :)
 
 

Re:Create database in runtime

Turbo Man writes:
Quote
Hi all,

I use Interbase, I want my application to create database in runtime,
I see the "create database" sql, but how to execute a query without
connected to
a presented database?

TIA

Turbo Man :)


Hi!
I use this statement
SET SQL DIALECT 3;
CREATE DATABASE 'c:\mybase.gdb'
USER 'SYSDBA' PASSWORD 'masterkey'
PAGE_SIZE 4096
DEFAULT CHARACTER SET ISO8859_1;
CREATE DOMAIN ID INTEGER NOT NULL;
CREATE TABLE Test (
IDTest ID,
Desc VARCHAR(20)
);
Pablo
 

Re:Create database in runtime

What is your DBMS? On MS SQL Server, connect to master db.
//------------------------------------------
Regards,
Vassiliev V. V.
www.managed-vcl.com - using .Net objects in Delphi for Win32 +
ADO.Net
www.oledbdirect.com - The fastest way to access MS SQL Server,
MS Jet (Access) and Interbase (through OLEDB)
"Turbo Man" <XXXX@XXXXX.COM>酉下萆?酉下萆塘 ?蜗紫釉讶 犹拍绽菖?
Quote
Hi all,

I use Interbase, I want my application to create database in runtime,
I see the "create database" sql, but how to execute a query without
connected to
a presented database?

TIA

Turbo Man :)


 

Re:Create database in runtime

Use the CreateDatabase method of the IBDatabase component.
--
Bill (TeamB)
TeamB cannot answer questions received via email
 

Re:Create database in runtime

Thank you, bill.
This method is really simple and it works fine. :)
BTW, for other DBMS, is there a same method?
Thanks
Hermann
"Bill Todd" <XXXX@XXXXX.COM>写入消息新闻:XXXX@XXXXX.COM...
Quote
Use the CreateDatabase method of the IBDatabase component.

--
Bill (TeamB)
TeamB cannot answer questions received via email
 

Re:Create database in runtime

It depends on the database.
--
Bill (TeamB)
TeamB cannot answer questions received via email
Turbo Man writes:
Quote
BTW, for other DBMS, is there a same method?
 

Re:Create database in runtime

Thank you, bill.
In normal purpose, I write a SQL script to create database(s), it is easy.
but I hope it can be done by app itself while first load. for oracle,
sybase, etc.
Best regards
Turbo Man
"Bill Todd" <XXXX@XXXXX.COM>写入消息新闻:41a4964a$XXXX@XXXXX.COM...
Quote
It depends on the database.
 

Re:Create database in runtime

You need to look at the SQL for creating a database for each of the
database servers you plan to use. I suspect you will find the syntax is
different for each.
--
Bill (TeamB)
TeamB cannot answer questions received via email
Turbo Man writes:
Quote
Thank you, bill.

In normal purpose, I write a SQL script to create database(s), it's
easy. but I hope it can be done by app itself while first load. for
oracle, sybase, etc.

Best regards

Turbo Man

"Bill Todd" <XXXX@XXXXX.COM>
P4HkO{O"PBNE:41a4964a$XXXX@XXXXX.COM...
>It depends on the database.