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.
AV on Starting program SQLiteConnection problem
Re: AV on Starting program SQLiteConnection problem
hello,
In order to make a connection set in design-time not to open in runtime, you should set the KeepDesignConnected property to False:
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;