Page 1 of 1

Create database (Firebird)

Posted: Wed 25 Feb 2009 12:51
by chkaufmann
Hi,

I saw that there is code to create a new (empty) database with Interbase/Firebird, deep in the library (In IBCClassesUni.pas).

But what is the correct component (and settings) to use to create a new database?

cu Christian

Posted: Thu 26 Feb 2009 08:04
by Plash
You can execute CREATE DATABASE statement from the TUniScript component. Such statement is executed using the CreateDatabase method from IBCClassesUni.

Posted: Thu 26 Feb 2009 08:59
by chkaufmann
Plash wrote:You can execute CREATE DATABASE statement from the TUniScript component. Such statement is executed using the CreateDatabase method from IBCClassesUni.
Can you provide some sample code? I tried this, but for TUniScript I need a connection and once I call Execute, the library tries to connect to the non existing database.

cu Christian

Posted: Thu 26 Feb 2009 09:54
by Plash
The current version of TUniScript requires the connection to an existing database to be opened before executing the script.

We'll consider possibility to add support for executing the CREATE DATABASE statement without opened connection in one of the next UniDAC builds.

Posted: Wed 04 Mar 2009 12:02
by Plash
In the next UniDAC build we'll add the NoPreconnect property to TUniScript. You should set it to True for executing CREATE DATABASE statement.