Page 1 of 1

AV on Starting program SQLiteConnection problem

Posted: Thu 14 Feb 2013 17:09
by heerdinm
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.

Re: AV on Starting program SQLiteConnection problem

Posted: Fri 15 Feb 2013 12:55
by AlexP
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;

Re: AV on Starting program SQLiteConnection problem

Posted: Fri 15 Feb 2013 15:20
by heerdinm
thank you