Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to create databases programmatically using DBX?

Looks like the TSQLConnection only connects to existing databases, and I could not find another component that allows me to send commands to the database server.

I'm using Delphi 2009 with Firebird and MSSQL.

One idea that came was to connect to a system database (master or tempdb in MSSQL for example) and then send create commands to the server. This could be an option for MSSQL, but I'm not sure for Firebird.

I'm also aware of the new DBX metadata in Delphi 2009, but I couldn't find a way to create databases using it. All examples I've found is to modify existing databases.

like image 524
Erick Sasse Avatar asked Dec 30 '08 12:12

Erick Sasse


1 Answers

Yes, you can. dbExpress now includes a powerful set of meta-data classes for doing just that.

Steve Shaughnessy gives a good introduction here.

like image 190
Nick Hodges Avatar answered Oct 04 '22 13:10

Nick Hodges