LiteDAC

TLiteConnectionOptions.ForceCreateDatabase Property

Used to force TLiteConnection to create a new database before opening a connection, if the database doesn't already exist.

Class

TLiteConnectionOptions

Syntax

property ForceCreateDatabase: boolean default DefValForceCreateDatabase;

Remarks

By default, when connecting to a database, SQLite3 does not check whether there exists the specified file. If the TLiteConnection.Database property points to a non-existent database in correct system path, a new empty database will be created and opened, and no warning message will be displayed. In the case if an incorrect database name was entered by mistake, this behavior can lead to misunderstandings and errors in the operation of the software.

If the TLiteConnectionOptions.ForceDatabaseCreate property is set to False, before establishing a connection to the database, TLiteConnection will check whether the specified file exists. If the file does not exist, an appropriate exception will be raised.

If the TLiteConnectionOptions.ForceDatabaseCreate property is set to True, no checking will be performed and a new database will be created.

The default value of the TLiteConnectionOptions.ForceDatabaseCreate property is False.

See Also

© 1997-2024 Devart. All Rights Reserved. Request Support DAC Forum Provide Feedback