Create a Access Database at runtime

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
kaiserilich
Posts: 23
Joined: Tue 23 Mar 2010 08:36
Location: spain
Contact:

Create a Access Database at runtime

Post by kaiserilich » Tue 10 Jun 2014 11:27

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

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Re: Create a Access Database at runtime

Post by AlexP » Tue 10 Jun 2014 11:51

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.

kaiserilich
Posts: 23
Joined: Tue 23 Mar 2010 08:36
Location: spain
Contact:

Re: Create a Access Database at runtime

Post by kaiserilich » Tue 10 Jun 2014 13:35

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.!

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Re: Create a Access Database at runtime

Post by AlexP » Wed 11 Jun 2014 06:17

If you have any further questions, feel free to contact us.

Post Reply