ibec_ibe_GetDatabaseProp
The ibec_ibe_GetDatabaseProp function returns the value of specifed database property.
All ibec_ibe_xxx functions work only within IBExpert and will be ignored when IBEBlock is executed with IBEScript.exe or IBEScript.dll.
Syntax
function ibec_ibe_GetDatabaseProp(DatabaseID : integer; PropertyName : string) : variant;
The following properties are available:
| ALIAS | Alias of the registered database. |
| CLIENTLIB | Name of the client library file specified in the Database Registration Info. |
| SERVERNAME or HOSTNAME | Server name. |
| FILENAME or DBNAME | Database file name. |
| PASSWORD | Password specified in the database regstration info. |
| USERNAME or USER_NAME or USER | User name. |
| ROLENAME or ROLE_NAME or ROLE | Role name. |
| NAMES or LC_CTYPE or CHARSET | Connection charset. |
| CONNECTIONSTRING or CONNECTION_STRING | Connection string. |
| ACTIVE or CONNECTED | Returns TRUE if the database is active and FALSE if it is not. |
Example
execute ibeblock as
begin
CRLF = ibec_CRLF();
ActiveDB = ibec_ibe_GetActiveDatabaseID();
if (ActiveDB is not null) then
begin
if (ActiveDB = -1) then
Exit;
sAlias = ibec_ibe_GetDatabaseProp(ActiveDB, 'Alias');
sClientLib = ibec_ibe_GetDatabaseProp(ActiveDB, 'ClientLib');
sHost = ibec_ibe_GetDatabaseProp(ActiveDB, 'HostName');
sFileName = ibec_ibe_GetDatabaseProp(ActiveDB, 'FileName');
sPassword = ibec_ibe_GetDatabaseProp(ActiveDB, 'Password');
sUser = ibec_ibe_GetDatabaseProp(ActiveDB, 'User');
sRole = ibec_ibe_GetDatabaseProp(ActiveDB, 'Role');
sCharset = ibec_ibe_GetDatabaseProp(ActiveDB, 'Names');
sConnectionStr = ibec_ibe_GetDatabaseProp(ActiveDB, 'ConnectionString');
bActive = ibec_ibe_GetDatabaseProp(ActiveDB, 'Connected');
s = 'Database alias: ' + sAlias + CRLF +
'Client library: ' + sClientLib + CRLF +
'Server name: ' + sHost + CRLF +
'Database file name: ' + sFileName + CRLF +
'User name: ' + sUser + CRLF +
'Password: ' + sPassword + CRLF +
'Role: ' + sRole + CRLF +
'Charset: ' + sCharset + CRLF +
'Connection string: ' + sConnectionStr;
if (bActive) then
s .= CRLF + CRLF + 'Database is active.';
ibec_ShowMessage(s);
end
end
back to top of page
<< ibec_ibe_GetActiveDatabaseID | IBEBlock | ibec_ibe_GetObjectEditorProp >>







