create a database

Forum related to Firebird

Moderators: gto, cipto_kh, EgonHugeist

Post Reply
fcodebue
Junior Boarder
Junior Boarder
Posts: 32
Joined: 05.04.2008, 16:02
Contact:

create a database

Post by fcodebue »

I need to create a database ....
which is the best way?
Codebue Fabio
P-Soft - http://www.p-soft.biz
Firebird La Comunità Italiana - http://www.firebirdsql.it
GestionaleOpen - http://www.gestionaleopen.org
seawolf
Zeos Dev Team *
Zeos Dev Team *
Posts: 385
Joined: 04.06.2008, 19:50
Contact:

Post by seawolf »

fdb := TZConnection.Create(nil);
sqlstr := Format('CreateNewDatabase=CREATE DATABASE ''%s'' USER ''SYSDBA'' PASSWORD ''masterkey'' PAGE_SIZE 16384 DEFAULT CHARACTER SET NONE', [dbfullname]);
fdb.Properties.Clear;
fdb.Properties.Add(sqlstr);
fdb.Properties.Add('Dialect=3');
fdb.Properties.Add('hard_commit=yes');
fdb.Database := dbfullname;
fdb.Protocol := 'firebirdd-2.0';
fdb.TransactIsolationLevel := tiReadCommitted;
fdb.Open;
CamelTM
Fresh Boarder
Fresh Boarder
Posts: 1
Joined: 18.09.2009, 09:11

Post by CamelTM »

Instead fdb.Open:

fdb.Connect;
fdb.Disconnect;
fdb.Free;
Post Reply