SDAC

TMSCompactConnectionOptions.ForceCreateDatabase Property

Used to force TMSCompactConnection to create a new database before opening a connection, if the database is not exists.

Class

TMSCompactConnectionOptions

Syntax

property ForceCreateDatabase: boolean;

Remarks

By default, when connecting to a database, SQL Server does not check whether there exists the specified file. If the TMSCompactConnection.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 TMSCompactConnectionOptions.ForceDatabaseCreate property is set to False, before establishing a connection to the database, TMSCompactConnection will check whether the specified file exists. If the file does not exist, an appropriate exception will be raised.

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

The default value of the TMSCompactConnectionOptions.ForceCreateDatabase property is False.

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

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