Re: detecting the BDE version

Posted by John, DelphiLand Team on December 14, 2007

In Reply to Re: detect BDE version posted by Newb on December 13, 2007

: : procedure TForm1.Button1Click(Sender: TObject);
: : var
: : BDEInstalled: Boolean;
: : begin
: : BDEInstalled := (dbiInit(nil) = 0);
: : if BDEInstalled then
: : ShowMessage('The BDE is installed')
: : else
: : ShowMessage('The BDE is NOT installed');
: : end;

: Thanks, works great!
: If the BDE is installed, how can I find out which version?
: I read that at least version 5.2 is needed for Turbo Delphi, is that correct?

BDE version 5.2 is just a minor improvement over the previous version, therefore database applications developed with Turbo Delphi work on computers with a BDE version 5.0 and up.

By "version of the Borland Database Engine" we mean in fact: the version of the file IDAPI.DLL. Getting the version of that file in your program goes like this:

1. From the registry key "HKEY_LOCAL_MACHINE\Software\Borland\Database Engine", read the path (location on disk) of the file IDAPI.DLL.

2. Set up a temporary buffer for the file version info of IDAPI.DLL.

3. Read the file version structure info into the buffer.

4. Get the file version from the correct location of the buffer.

The source code is too long to explain here in detail, so we'll write a tutorial about it in DelphiLand's section "Code Snips".