Page 1 of 1

create a database

Posted: 01.09.2009, 11:20
by fcodebue
I need to create a database ....
which is the best way?

Posted: 02.09.2009, 10:15
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;

Posted: 18.09.2009, 09:45
by CamelTM
Instead fdb.Open:

fdb.Connect;
fdb.Disconnect;
fdb.Free;