Subject | Re: [firebird-support] Create Database Process |
---|---|
Author | Robert martin |
Post date | 2005-01-28T03:34:19Z |
Hi Myles
I don't know what 4th Dimension is (I assume its a DB tool), but if what
you are wanting to do is ship an application without a database and have
your application build it from a script, this should be simple.
Our app ships with a script containing
SET TERM ^ ;
/* Connect using username: SYSDBA */
/* and server: WI-V6.3.1.4481 Firebird 1.5 */
SET SQL DIALECT 3^
SET AUTODDL ON^
CREATE DATABASE 'BS3'
USER 'SYSDBA' PASSWORD 'masterkey'
DEFAULT CHARACTER SET NONE^
CREATE GENERATOR WORKCONTROL_Gen^
.......
We use IBObjects to run the script but other components should be
fine. We configure our connection but don't connect, point it to where
we want the DB and replace the 'BS3' in the file with a valid Firebird
path and name. Every thing works great.
Hope this helps.
Rob Martin
Software Engineer
phone +64 03 377 0495
fax +64 03 377 0496
web www.chreos.com
Wild Software Ltd
Myles Wakeham wrote:
I don't know what 4th Dimension is (I assume its a DB tool), but if what
you are wanting to do is ship an application without a database and have
your application build it from a script, this should be simple.
Our app ships with a script containing
SET TERM ^ ;
/* Connect using username: SYSDBA */
/* and server: WI-V6.3.1.4481 Firebird 1.5 */
SET SQL DIALECT 3^
SET AUTODDL ON^
CREATE DATABASE 'BS3'
USER 'SYSDBA' PASSWORD 'masterkey'
DEFAULT CHARACTER SET NONE^
CREATE GENERATOR WORKCONTROL_Gen^
.......
We use IBObjects to run the script but other components should be
fine. We configure our connection but don't connect, point it to where
we want the DB and replace the 'BS3' in the file with a valid Firebird
path and name. Every thing works great.
Hope this helps.
Rob Martin
Software Engineer
phone +64 03 377 0495
fax +64 03 377 0496
web www.chreos.com
Wild Software Ltd
Myles Wakeham wrote:
> > On 27-Jan-2005 20:03:50, Helen Borrie wrote:
> > Just send a valid CREATE DATABASE or CREATE SCHEMA statement through
> the
> > API by whatever means you normally communicate through the API.
> Follow it
>
> > up with a COMMIT statement and the server will connect to the new
> database
>
> > and send the database handle back to the waiting application --
> exactly as
>
> > it does when isql happens to be the waiting application.
>
> I'm trying to do this from 4th Dimension right now, and I can execute SQL
> for the creation of the database just fine, but does this assume that once
> the database is created, the user is now connected and logged in as the
> User/Password that was specified for the database?
>
> If so, does this imply that it has the same affect as Connecting to the
> database afterwards, ie. That the user is 'attached' to the database,
> but no
> transaction has yet been created.
>
> If so, in order to do the COMMIT, how does one execute that? Isn't a
> COMMIT
> only associated with a transaction?
>
> R