Subject | Creating New Database |
---|---|
Author | dkoder2 |
Post date | 2007-01-17T22:05:52Z |
I am trying to create a new Firebird 2.0 database from within my
application visual basic 6.0 source code. I can accomplish this with
no problem using ADO provided there is a database to open. Code snipet:
'Firebird SQL - Windows connection string
cnBase = adoConn.FirebirdSQL_Server("192.16x.x.xx", "Employee.fdb",
"C:\Program Files\Firebird_2_0\", "SYSDBA", "masterkey")
cnBase.Open
Now that I have a database open I can create a new one using this code
snipet:
'Create a new database
sql = "Create Database '192.16x.x.xx:C:\Program
Files\Firebird_2_0\test.fdb' user 'SYSDBA' password 'masterkey'
PAGE_SIZE 8192 DEFAULT CHARACTER SET ISO8859_1"
cnBase.Execute sql
I can then continue by adding tables, etc. The problem is that a
database must exist before the new database can be created.
I have tried using several iterations of the following code snipet:
msgRetVal = Shell("C:\Program Files\Firebird_2_0\Bin\isql CREATE
DATABASE '192.16x.x.xx:c:/Program Files/ONFIRE.FDB' user 'SYSDBA'
password 'secret' DEFAULT CHARACTER SET ISO8859_1;", vbHide)
Can someone help point me in a productive direction?
TIA
application visual basic 6.0 source code. I can accomplish this with
no problem using ADO provided there is a database to open. Code snipet:
'Firebird SQL - Windows connection string
cnBase = adoConn.FirebirdSQL_Server("192.16x.x.xx", "Employee.fdb",
"C:\Program Files\Firebird_2_0\", "SYSDBA", "masterkey")
cnBase.Open
Now that I have a database open I can create a new one using this code
snipet:
'Create a new database
sql = "Create Database '192.16x.x.xx:C:\Program
Files\Firebird_2_0\test.fdb' user 'SYSDBA' password 'masterkey'
PAGE_SIZE 8192 DEFAULT CHARACTER SET ISO8859_1"
cnBase.Execute sql
I can then continue by adding tables, etc. The problem is that a
database must exist before the new database can be created.
I have tried using several iterations of the following code snipet:
msgRetVal = Shell("C:\Program Files\Firebird_2_0\Bin\isql CREATE
DATABASE '192.16x.x.xx:c:/Program Files/ONFIRE.FDB' user 'SYSDBA'
password 'secret' DEFAULT CHARACTER SET ISO8859_1;", vbHide)
Can someone help point me in a productive direction?
TIA