Page 1 of 1

Create a Access Database at runtime

Posted: Tue 10 Jun 2014 11:27
by kaiserilich
Hi,

I need create a empty access database at runtime execution. I try to create directly using the ExecSql from the UniConnection but doesn't work...

Code: Select all

Connection.ExecSQL('CREATE DATABASE c:\temp\tmp.mdb');
how I can create the database on execution time? is possible?

using:
Delphi 6 up 2
unidac 5.3.9


thanks a lot

Re: Create a Access Database at runtime

Posted: Tue 10 Jun 2014 11:51
by AlexP
Hello,

To create a new DB, you should set the UniConnection1.SpecificOptions.Values['ForceCreateDatabase'] option to True, and specify the new DB file in the DataBase property. When opening connection, a database will be created automatically.

Re: Create a Access Database at runtime

Posted: Tue 10 Jun 2014 13:35
by kaiserilich
AlexP wrote:Hello,

To create a new DB, you should set the UniConnection1.SpecificOptions.Values['ForceCreateDatabase'] option to True, and specify the new DB file in the DataBase property. When opening connection, a database will be created automatically.
:D

Thanks a lot.!

Re: Create a Access Database at runtime

Posted: Wed 11 Jun 2014 06:17
by AlexP
If you have any further questions, feel free to contact us.