0

I've downloaded free DBX driver from here.

I am trying to make it work since two days now, without success.

Here is the snapshot of my code:

unit uMainForm;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, SqlExpr, WideStrings, DBXDynalink, DB;

type
  TMainForm = class(TForm)
    Button1: TButton;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  MainForm: TMainForm;

implementation

{$R *.dfm}

procedure TMainForm.Button1Click(Sender: TObject);
var C: TSQLConnection;
begin
  C := TSQLConnection.Create(Self);
  try
    C.DriverName := 'FirebirdConnection';
    C.LibraryName := 'dbxfb4d12.dll';
    C.VendorLib := 'fbclient.dll';
    C.GetDriverFunc := 'getSQLDriverFIREBIRD';
    C.Params.Add('User_Name=SYSDBA');
    C.Params.Add('Password=masterkey');
    C.Params.Add('Database=C:\MyDB.fdb');
    C.Open;
    if C.Connected then
      ShowMessage('Connection is active')
  finally
    C.Free;
  end;
end;

After running the test I am receiving error: "Unable to load fbclient.dll(ErrorCode 22). It may be missing from the system path."

I have required libraries in my application path, I have them even in the System32 path. I am not using dbxdrivers.ini and dbxconnections.ini.

So what is going on here? I have Delphi 2009 with latest updates.

Thanks for your time.

Community
  • 1
  • 1
Wodzu
  • 6,932
  • 10
  • 65
  • 105
  • Has anyone had success with that component? All I've ever heard about it are people with problems. – David Heffernan Aug 10 '11 at 09:48
  • I would first try to make it work with the *.ini files, I've seen too many posts failing while trying not to include them. [Here's one](https://forums.embarcadero.com/message.jspa?messageID=20783) such thread. – Sertac Akyuz Aug 10 '11 at 10:50
  • I did try it with the ini, trust me... But thanks for the tip. I've decided to give up and I've used a commercial solution from devart (currently on trial) which works without any problems. – Wodzu Aug 11 '11 at 09:22
  • @David - I did get it to work... finally. You can't wire anything up in the IDE... it all has to be done at runtime. I'd much rather use a driver that let's me build and see things in the IDE. – Michael Riley - AKA Gunny Aug 11 '11 at 23:28
  • @cape There are lots of good drivers around so I don't understand the attraction of this one. – David Heffernan Aug 11 '11 at 23:31
  • @David - The attraction - FREE!. – Michael Riley - AKA Gunny Aug 12 '11 at 18:27

2 Answers2

0

Did you also try to put the fbclient.dll file in the same folder as the executable?

Birger
  • 4,343
  • 21
  • 35
0

Sometimes it's necessary to have the fbclient.dll renamed to gds32.dll. It might do the trick.

Attila Fulop
  • 6,861
  • 2
  • 44
  • 50