ibec_CreateDatabase

ibec_CreateDatabase replaces the CREATE DATABASE command within IBEBlocks. CREATE DATABASE is still available for compatibility.

Syntax

 function ibec_CreateDatabase(DatabaseType : integer; DatabaseProps : string) : variant; 

ibec_Database attempts to create a new database using the specified properties and, if successful, returns a handle of the connection to the database just created. Otherwise it returns NULL and raises an exception.

Parameters

DatabaseTypeType of the database to be created. Currently only _ctFirebird/__ctDatabase is supported.
DatabasePropsList of the new database properties, delimited with semicolon. Following properties are available:
DBName=<path_to_a_database>A new database file specification; file naming conventions are platform-specific.
ClientLib=<path to client library>Client library file name; default: gds32.dll.
User=<user_name>User name.
Password=<password>Password.
PageSize=<page_size_value>Size, in bytes, for database pages.
page_size=<page_size_value>The same as PageSize.
DefaultCharset=<charset_name>The default character set for the new database.
lc_ctype=<charset_name>Same as DefaultCharset.
SQLDialect=<dialect_number>The SQL dialect for the new database, either 1, 2, or 3.
sql_dialect=<dialect_number>The same as SQLDialect.

Example

 execute ibeblock
 as
 begin 
   try
     MyDB = ibec_CreateDatabase(__ctFirebird, 'DBName="localhost:d:\my databases\mydb.fdb";
                                ClientLib="C:\Program Files\Firebird\bin\fbclient.dll"; 
                                User=SYSDBA; Password=masterkey; PageSize=16384;
                                DefaultCharset=WIN1252; SQLDialect=3');
   except
     exit;
   end;

   ibec_UseConnection(MyDB);
   ...
 end;

See also:
Create database

back to top of page
<< ibec_StartTraceSession | IBEBlock | ibec_OnlineDatabase >>