Subject how to create database from script
Author Queck Rainer
Hi List,

I have a scrip that workes fine from within IB_Expert.
There I can execute this script and create my database.

How can I achieve the same result with "TIB_Script" using the same script file?

I tried :

GenDbScr.SQL.LoadFromFile(FSqlScript);
GenDbScr.Sql.SaveToFile('C:\temp\spc.sql');
GenDbScr.Execute;

but here I get "Statement must have an IB_Connection assigned.
Well I assigned my IB_Connection but then I get the
"invalid database handle (no active connection)" message.

Well then I set the DbConnection.Connected:=True and recieved the "can't finde file"message which is true, since I in this moment have no database....

What is the right way to create a database with a given script?

Thanks for hints
Rainer

//snip form script....
//=============

/******************************************************************************/
/**** SPC Database ****/
/******************************************************************************/

SET SQL DIALECT 3;

SET NAMES ISO8859_1;

CREATE DATABASE '<MyServer>:<Desired paht and db name>'
USER '<MyUser>' PASSWORD '<my password>'
PAGE_SIZE 8192
DEFAULT CHARACTER SET ISO8859_1
FILE '<Desired file1>' LENGTH 244000 PAGES
FILE '<Desired file2>' LENGTH 244000 PAGES
.................
FILE '<Desired file n>' LENGTH 244000 PAGES ;

/* ====================== DOMAINS ============================================*/
CREATE DOMAIN D_STREAM AS BLOB SUB_TYPE 0 SEGMENT SIZE 80;

...... and so on.
As mentioned the script works fine from within IB-Expert.