Subject Executing ddl scripts
Author tickerboo2002
Can I execute a ddl script from my application only before I connect,
or can I execute them anytime? (Accepting the fact that it may screw
up some other connections)

I wish to do the following:

When I ship my program to customers, the exe knows the database
version it should be running with. The exe can also read the actual
database version from one of my tables. If it finds it should be
running with a Version 3 database, but the current database is only
version 1, I want to run the following scipt from the line 'Version 1'

Version 1
ddl
ddl
Version 2
ddl
ddl
Version 3
ddl
ddl

The only ddl I've done so far is in the TIB_Connection::BeforeConnect
event:

if ( cnMain->Protocol == cpLocal && ! FileExists( cnMain->Path ))
scrCreateDB->Execute();


In order to update the database, would I have to connect to the
database, determine the db version and then disconnect to do the ddl
if required?

TIA

David