meta data for this page
  •  

ibec_GetUserDBConnection

The ibec_GetUserDBConnection function returns the pointer to the User Database (found in the IBExpert Options menu under Environment Options / User Database, if it is used. Otherwise this function returns NULL.

Description

No additional description…

Syntax

 function ibec_GetUserDBConnection : variant;

Example

   execute ibeblock
   as
   begin
     CRLF = ibec_CRLF();
     sTab = ibec_Chr(9);
     sLine = '==============================================';
          UserDB = ibec_GetUserDBConnection();
     if (UserDB is not null) then
     begin
       sMes = '';
            sHost = ibec_GetConnectionProp(UserDB, 'HostName');
       sFile = ibec_GetConnectionProp(UserDB, 'FileName');
       sServerVersion = ibec_GetConnectionProp(UserDB, 'ServerVersion');
       sDBSqlDialect = ibec_GetConnectionProp(UserDB, 'DBSqlDialect');
       sClientLib = ibec_GetConnectionProp(UserDB, 'ClientLib');
       sUser = ibec_GetConnectionProp(UserDB, 'UserName');
       sPass = ibec_GetConnectionProp(UserDB, 'Password');
       sNames = ibec_GetConnectionProp(UserDB, 'lc_ctype');
            iPageSize = ibec_GetConnectionProp(UserDB, 'PageSize');
       iSweep = ibec_GetConnectionProp(UserDB, 'SweepInterval');
       iODSMinorVersion = ibec_GetConnectionProp(UserDB, 'ODSMinorVersion');
       iODSMajorVersion = ibec_GetConnectionProp(UserDB, 'ODSMajorVersion');
            sMes = 'User Database properties' + CRLF + sLine + CRLF;
       sMes .= 'Database host: ';
       if (sHost = '') then
         sMes .= sTab + '(local)';
       else
         sMes .= sTab + sHost;
            sMes .= CRLF +
               'Database file: ' + sTab + sFile + CRLF +
               'Server version: ' + sTab + sServerVersion + CRLF +
               'Client library: ' + sTab + sClientLib + CRLF + CRLF +
                    'Page size, bytes: ' + sTab + ibec_Cast(iPageSize, __typeString) + CRLF +
               'Sweep interval: ' + sTab + sTab + ibec_Cast(iSweep, __typeString) + CRLF +
               'ODS version: ' + sTab + sTab + ibec_Cast(iODSMajorVersion, __typeString) + '.' +
                    ibec_Cast(iODSMinorVersion, __typeString) + CRLF + CRLF +
                    'Connection username: ' + sTab + sUser + CRLF +
               'Connection password: ' + sTab + sPass + CRLF +
               'Connection charset: ' + sTab + sNames + CRLF;
                 ibec_UseConnection(UserDB);
            sMes .= CRLF + CRLF + 'User Database tables' + CRLF + sLine + CRLF;
       for select rdb$relation_name
           from rdb$relations
           where (rdb$system_flag is null) or (rdb$system_flag = 0)
           order by rdb$relation_name
           into :RelName
       do
       begin
         RelName = ibec_Trim(RelName);
         sMes .= RelName + CRLF;
       end
       commit;
            ibec_ShowMessage(sMes);
     end
   end