Leigh,

There are TWO version numbers in the BDE.  Note that BDE Admin will report
the two version numbers in two different places too,  I use the following
code.

The relevant part is extracting iIntfLevel from the version info.

Wes Edwards

var
  MyList : TStringList;
  MySysVersion : SYSVersion;
begin
  Result := false;
  try
    MyList := TStringList.Create;
    try
      Check(dbiInit(nil));
      Check(DbiGetSysVersion(MySysVersion));
      Check(dbiExit);
      if (MyList <> nil) then
      begin
        with MyList do
        begin
          Clear;
          Add('Borland Database Engine Initialised OK');
          Add('');
          Add('System Information:');
          Add(Format('Engine Version=%d', [MySysVersion.iVersion]));
          Add(Format('Interface Level=%d', [MySysVersion.iIntfLevel]));
        end;
        Result := true;
      end;
    except
      // cannot initialise BDE
    end;
  finally
    MyList.Free;
  end;
end;

> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On
> Behalf Of Leigh Wanstead
> Sent: Monday, 8 May 2000 15:16
> To: Multiple recipients of list delphi
> Subject: [DUG]: Get BDE Version
>
>
> Hello everyone,
>
> I use following code to get version of BDE.
> But it seems not work with BDE5.11.
>
> What is wrong with this piece of code?
>
> Duplicate procedure:
> 1) Drop a button on the form
> 2) Drop a label on the form
> 3) Link button onclick event with following code
>
> procedure TForm1.Button1Click(Sender: TObject);
> var
>   BDESYSVersion: SYSVersion;
>   s: String;
> begin
>   if dbiGetSysVersion(BDESYSVersion) = DBIERR_NONE then
>     s := Format('%f', [BDESYSVersion.iVersion / 100])
>   else
>     s := '';
>   Label1.Caption := s;
> end;
>
> // and result shows 5.00
>
> Thanks in advance.
> I look forward to hearing from you.
>
> Best Regards
> leigh
>
> ------------------------------------------------------------------
> ---------
>     New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
>                   Website: http://www.delphi.org.nz
>

---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz

Reply via email to