AV on Starting program SQLiteConnection problem

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
heerdinm
Posts: 14
Joined: Fri 14 Dec 2012 11:35

AV on Starting program SQLiteConnection problem

Post by heerdinm » Thu 14 Feb 2013 17:09

Hello,

In my TDataModule i use a TUniConnection. The connection is set to an SQLite database.
When i start my program, i use FormActivate to set up the Database Connection.
The problem i have is that before it gets to execute the FormActivate of the Main form, the TDataModule is loaded and upon loading, it is checked (if the TUniConnection.Connected := True) if the database exists.
If the Database does not Exists, my program gives an AV.
If i set the database at designtime at Connected := False, then everything goes ok.
I forget things like this, especially because when i am desining, i need a connection to my database. Is there any way to prevent this?
Using MSAccess i have no problems.

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

Re: AV on Starting program SQLiteConnection problem

Post by AlexP » Fri 15 Feb 2013 12:55

hello,

In order to make a connection set in design-time not to open in runtime, you should set the KeepDesignConnected property to False:

Code: Select all

UniConnection1.Options.KeepDesignConnected := False;

heerdinm
Posts: 14
Joined: Fri 14 Dec 2012 11:35

Re: AV on Starting program SQLiteConnection problem

Post by heerdinm » Fri 15 Feb 2013 15:20

thank you

Post Reply