Creating a database with UniDAC
Creating a database with UniDAC
Hi,
can you give me an example on how to create a database with UniDAC?
I have no problem using TGDSConnection for that, this is entirely possible in my application.
Thanks,
Martijn Tonies
Upscene Productions
can you give me an example on how to create a database with UniDAC?
I have no problem using TGDSConnection for that, this is entirely possible in my application.
Thanks,
Martijn Tonies
Upscene Productions
Example Please
Can you give us an example that how can we create database using .sql text files?please share a demo using uniscript and unidac. thanks.
Use the SQL text like the following:
Use the Pascal code like the following:
UniScript1.SQL.LoadFromFile('sql.txt');
UniScript1.NoPreconnect := True;
UniScript1.Execute;
Code: Select all
CREATE DATABASE 'C:\db.gdb'
USER 'sysdba' PASSWORD 'masterkey'
PAGE_SIZE 4096
UniScript1.SQL.LoadFromFile('sql.txt');
UniScript1.NoPreconnect := True;
UniScript1.Execute;
Code: Select all
Correct me if I am wrong but this doesn't work in PostgreSQL if you don't have a database already created because the Connection property requires a database, even if Nopreconnect=True;
edited to add: I discovered that the default installation of PostgreSQL (at least in 8.4) creates a default database "postgres". My mistake was deleting this default database. I suggest you don't delete it if you plan to programmatically create databases, until atleast one database is created because its a real hassle to create new databases without an initial database since the user login generally requires a database to log on to.
edited to add: I discovered that the default installation of PostgreSQL (at least in 8.4) creates a default database "postgres". My mistake was deleting this default database. I suggest you don't delete it if you plan to programmatically create databases, until atleast one database is created because its a real hassle to create new databases without an initial database since the user login generally requires a database to log on to.