Delphi32.com - Home!
| Home/News | Downloads | Forums | D32 Magazine | Resources | Info and Facts |  
 
 Retrieving BDE system information


How can I get BDE system status such as size of buffer and heap used, or number of currently loaded drivers, active clients, sessions, databases or cursors?   

    Use the BDE api call DbiGetSysInfo. The following example outputs the results to a text log file.

    implementation
    uses dbierrs, dbiprocs, dbitypes;
    {$R *.DFM}
    procedure LogDbiSysInfo(const LogFile: string);
    var
      Info: SYSInfo;
    begin
      DbiGetSysInfo(Info);
      with TStringList.Create do
      try
        Clear;
        Add(Format('BUFFER SPACE: %d', [Info.iBufferSpace]));
        Add(Format('HEAP SPACE:   %d', [Info.iHeapSpace]));
        Add(Format('DRIVERS:      %d', [Info.iDrivers]));
        Add(Format('CLIENTS:      %d', [Info.iClients]));
        Add(Format('SESSIONS:     %d', [Info.iSessions]));
        Add(Format('DATABASES:    %d', [Info.iDatabases]));
        Add(Format('CURSORS:      %d', [Info.iCursors]));
        SaveToFile('c:\logcurs.txt');
      finally
        Free;
      end;
    end;
    procedure TForm .Button Click(Sender: TObject);
    begin
      table .Open;
      table2.open;
      table3.Open;
      LogDbiSysInfo('c:\logcurs.txt');
    end;

    end.

    Output for logcurs.txt: ----------------------- BUFFER SPACE: 28 HEAP SPACE: 60 DRIVERS: 2 CLIENTS: 2 SESSIONS: 2 DATABASES: 4 CURSORS: 3

     



  << Previous Faq     Complete List     Next Faq >>  



 
 Hits/month  2,500,000+ 
 Downloads
 (Since May 2000)
 7,393,709 
 Total Files  6,023 
 Forum msgs  7,670 
 Articles/FAQs  70+/900+ 
Kylix
Tips n Tricks
FAQs
Knowledge Base
Bug Listings
Articles
Books
Newsgroups
Links
Submissions
Testimonials
Advertising
Contact Us
About Us
Search Amazon:
Top Selling Software at Amazon

| Home/News | Downloads | Forums | Resources | Info and Facts | Testimonials |
  Site Search:
 


Comments/Problems: Webmaster@delphi32.com
Copyright © 1998-2006, Delphi32.com. All rights reserved.
Terms of Use