AV on Starting program SQLiteConnection problem
Posted: 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.
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.