Page 1 of 1

Create database by code

Posted: 07.06.2010, 18:31
by sandro.carrara
Is there a way to create a new database from Delphi code with a Zeos component (component.createdatabase or "create database db') ?
Thanks

Posted: 08.06.2010, 07:35
by seawolf
Yes, there is a way but it depends on the db you want to create.

Posted: 08.06.2010, 11:26
by jeremicm

Code: Select all

ZQuery1.SQL.Add('CREATE DATABASE insert-database-name-here');
ZQuery1.ExecSQL;

Posted: 08.06.2010, 11:31
by sandro.carrara
Thanks, with zconnection.executedirect('create database xxx') on MySQL works fine, now I'll try with Firebird and Postgresql.