Bde.DBTables.TSession.OpenDatabase
Delphi
function OpenDatabase(const DatabaseName: string): TDatabase;
C++
TDatabase* __fastcall OpenDatabase(const System::UnicodeString DatabaseName);
Properties
Type | Visibility | Source | Unit | Parent |
---|---|---|---|---|
function | public | Bde.DBTables.pas Bde.DBTables.hpp |
Bde.DBTables | TSession |
Description
Opens an existing database, or creates a temporary database component and opens it.
Call OpenDatabase to connect to a database for which a persistent database component already exists, or to create a temporary database component and connect to a database. DatabaseName specifies the database to open.
OpenDatabase makes the current session active, then calls FindDatabase to determine if the DatabaseName parameter corresponds to the DatabaseName property of an existing database component. If it does not, OpenDatabase creates a temporary database component, assigning the DatabaseName parameter to the DatabaseName property. Finally, OpenDatabase calls the Open method of the database to connect to a database server, then increments the database reference count of the session by one.