Retrieving Information About a Session
Go Up to Managing database sessions Index
You can retrieve information about a session and its database components by using a session's informational methods. For example, one method retrieves the names of all aliases known to the session, and another method retrieves the names of tables associated with a specific database component used by the session. The following table summarizes the informational methods to a session component:
Database-related informational methods for session components
| Method | Purpose |
|---|---|
|
Retrieves the BDE driver for a specified alias of a database. | |
|
Retrieves the list of BDE aliases for a database. | |
|
Retrieves the list of parameters for a specified BDE alias of a database. | |
|
Retrieves configuration information from the BDE configuration file. | |
|
Retrieves the list of BDE aliases and the names of any TDatabase components currently in use. | |
|
Retrieves the names of all currently installed BDE drivers. | |
|
Retrieves the list of parameters for a specified BDE driver. | |
|
Retrieves the names of all stored procedures for a specified database. | |
|
Retrieves the names of all tables matching a specified pattern for a specified database. | |
|
Retrieves the names of all fields in a specified table in a specified database. |
Except for GetAliasDriverName, these methods return a set of values into a string list declared and maintained by your application. (GetAliasDriverName returns a single string, the name of the current BDE driver for a particular database component used by the session.)
For example, the following code retrieves the names of all database components and aliases known to the default session:
var
List: TStringList;
begin
List := TStringList.Create;
try
Session.GetDatabaseNames(List);
...
finally
List.Free;
end;
end;
TStringList *List = new TStringList();
try
{
Session->GetDatabaseNames(List);
.
.
.
}
catch (...)
{
delete List;
throw;
}
delete List;