Page 1 of 1
how can implement TIBCScript for executing CREATE DATABASE?
Posted: Tue 09 Aug 2011 17:42
by erasmoga
Hi, to help implement TIBCScript for executing CONNECT and CREATE DATABASE commands.
Delphi XE, Firebird 2.5, IBDAC 3.60.0.23 pro, Windows 7
Posted: Wed 10 Aug 2011 09:10
by AndreyZ
Hello,
You can create a Firebird database using the TIBCScript component in the following way:
Code: Select all
IBCScript.Connection := IBCConnection;
IBCScript.SQL.Clear;
IBCScript.SQL.Add('CREATE DATABASE');
IBCScript.SQL.Add('''DatabaseName''');
IBCScript.SQL.Add('USER ''SYSDBA''');
IBCScript.SQL.Add('PASSWORD ''masterkey''');
IBCScript.SQL.Add('PAGE_SIZE 4096');
IBCScript.SQL.Add('DEFAULT CHARACTER SET WIN1251');
IBCScript.Execute;
Also note that you can use the TIBCConnection component to achieve the same result. Here is an example:
Code: Select all
IBCConnection.Database := 'DatabaseName';
IBCConnection.ClientLibrary := 'fbclient.dll';
IBCConnection.Params.Clear;
IBCConnection.Params.Add('USER ''SYSDBA''');
IBCConnection.Params.Add('PASSWORD ''masterkey''');
IBCConnection.Params.Add('PAGE_SIZE 4096');
IBCConnection.Params.Add('DEFAULT CHARACTER SET WIN1251');
IBCConnection.CreateDatabase;
Posted: Wed 10 Aug 2011 19:50
by erasmoga
Hi AndreyZ, thanks for the speedy reply!