Delphi Examples: DbiGetSesInfo

<< Click to Display Table of Contents >>

Navigation:  »No topics above this level«

Delphi Examples: DbiGetSesInfo

Return to chapter overview

Get BDE session information. This function can return the SESInfo structure or clear and add the information to the SesInfoList TStringList. If nil is passed in, only the SESInfo structure is returned. This example uses the following input:

 Ses := fDbiGetSesInfo(MyList);

 

The function is:

function fDbiGetSesInfo(SesInfoList: TStringList): SESInfo;

begin

 Check(DbiGetSesInfo(Result));

if (SesInfoList <> nil) then

begin

  with SesInfoList do begin

     Clear;

     Add(Format('SESSION ID=%d', [Result.iSession]));

     Add(Format('SESSION NAME=%s', [Result.szName]));

     Add(Format('DATABASES=%d', [Result.iDatabases]));

     Add(Format('CURSORS=%d', [Result.iCursors]));

     Add(Format('LOCK WAIT=%d', [Result.iLockWait]));

     Add(Format('NET DIR=%s', [Result.szNetDir]));

     Add(Format('PRIVATE DIR=%s', [Result.szPrivDir]));

  end;

end;

end;