Create database by code

In this forum we will discuss things relating the ZEOSLib 6.6.x stable versions

Moderators: gto, EgonHugeist

Post Reply
sandro.carrara
Fresh Boarder
Fresh Boarder
Posts: 6
Joined: 25.02.2009, 09:21

Create database by code

Post 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
seawolf
Zeos Dev Team *
Zeos Dev Team *
Posts: 385
Joined: 04.06.2008, 19:50
Contact:

Post by seawolf »

Yes, there is a way but it depends on the db you want to create.
jeremicm
Senior Boarder
Senior Boarder
Posts: 61
Joined: 18.10.2006, 17:07
Contact:

Post by jeremicm »

Code: Select all

ZQuery1.SQL.Add('CREATE DATABASE insert-database-name-here');
ZQuery1.ExecSQL;
sandro.carrara
Fresh Boarder
Fresh Boarder
Posts: 6
Joined: 25.02.2009, 09:21

Post by sandro.carrara »

Thanks, with zconnection.executedirect('create database xxx') on MySQL works fine, now I'll try with Firebird and Postgresql.
Post Reply