[View Borland Home Page][View Product List][Search This Web Site][View Available Downloads][Join Borland Online][Enter Discussion Area][Send Email To Webmaster]

BDE API Examples (DbiGetSysVersion)

Retrieves the system version information, including the BDE version number, date, and time, and the client interface version number.

Get BDE system version information:

This example is included with Delphi in the BDE32.HLP file.

Example 1: Retrun BDE Major and Minor Version in a String

This example uses the following format:
label1.caption := getversioninformation;
function getversioninformation: string;

  function DetermineMinorVersion(IntfVer, Month, Day, Year: integer): integer;
  begin
    Result := -1;
    case IntfVer of
      3:
      begin
        if (Month = 12) and (Day = 1) and (Year = 1995) then
          Result := 0;
        if (Month = 2) and (Day = 4) and (Year = 1996) then
          Result := 10;
        if (Month = 6) and (Day = 1) and (Year = 1996) then
          Result := 11;
        if (Month = 8) and (Day = 22) and (Year = 1996) then
          Result := 12;
        if (Month = 9) and (Day = 19) and (Year = 1996) then
          Result := 50;
        if (Month = 12) and (Day = 2) and (Year = 1996) then
          Result := 51;
      end;
      4:
      begin
        if (Month = 3) and (Day = 11) and (Year = 1997) then
          Result := 0;
        if (Month = 7) and (Day = 16) and (Year = 1997) then
          Result := 1;
        if (Month = 10) and (Day = 28) and (Year = 1997) then
          Result := 50;
        if (Month = 11) and (Day = 14) and (Year = 1997) then
          Result := 51;
      end;
      5:
      begin
        Result := -1;
      end;
    end;
  end;

var
  Version: SYSVersion;
  Major, Minor: smallint;
  Month, Day: word;
  Year: smallint;

begin

  Result := 'Unknown';
  try try
    Check(DbiInit(nil));
    Check(DbiGetSysVersion(Version));
    Check(DbiDateDecode(Version.dateVer, Month, Day, Year));

    Major := Version.iVersion div 100;
    Minor := DetermineMinorVersion(Major, Month, Day, Year);
    if Minor = -1 then
      Result := Format('%d.xx (cannot determine minor version)', [Major])
    else
      if Minor < 10 then
        Result := Format('%d.0%d', [Major, Minor])
      else
        Result := Format('%d.%d', [Major, Minor]);
  except
  end;
  finally
    DbiExit;
  end;
end;

Back to BDE API Reference Page


DISCLAIMER: You have the right to use this technical information subject to the terms of the No-Nonsense License Statement that you received with the Borland product to which this information pertains.
Trademarks & Copyright © 1998 Borland International, Inc.