Is it possible to create a new Postgres database from my app using Zeos? If it is possible could someone give an example.
Regards
Sandeep
Creating Database from App using Zeos
Moderators: gto, cipto_kh, EgonHugeist, olehs
-
- Expert Boarder
- Posts: 158
- Joined: 06.11.2005, 01:43
Something like this...
auxZSQLProcessor := TZSQLProcessor.Create(Connection);
auxZSQLProcessor.Connection := Connection;
auxZSQLProcessor.Script.Text := 'CREATE DATABASE dbname WITH TEMPLATE = template0 ENCODING = ''UTF8'';';
auxZSQLProcessor.Execute;
First of all you must create a connection with the default postgres database.
Best regards
skaw
auxZSQLProcessor := TZSQLProcessor.Create(Connection);
auxZSQLProcessor.Connection := Connection;
auxZSQLProcessor.Script.Text := 'CREATE DATABASE dbname WITH TEMPLATE = template0 ENCODING = ''UTF8'';';
auxZSQLProcessor.Execute;
First of all you must create a connection with the default postgres database.
Best regards
skaw
-
- Expert Boarder
- Posts: 158
- Joined: 06.11.2005, 01:43