Search code examples
delphidelphi-xe2firebirdfirebird-embedded

Firebird Embedded & Delphi "unavailable database"


I'm using Firebird 2.5 (Embedded) And Delphi XE2.
I kept below files to my aplication root dir :

  • C:\myapp\app.exe
  • C:\myapp\fbclient.dll
  • C:\myapp\icudt30.dll
  • C:\myapp\icuin30.dll
  • C:\myapp\icuuc30.dll
  • C:\myapp\dbxfb.dll

And My Connection Settings :

procedure TMainForm.Button1Click(Sender: TObject);
var Con: TSQLConnection;
 begin
  Con := TSQLConnection.Create(Self); 
    With Con Do
     Begin
       Connected := False;
       DriverName := 'FirebirdConnection';

       Params.Clear;
       Params.Add('DriverName=' + DriverName);
       Params.Add('User_Name=SYSDBA');
       Params.Add('Password=masterkey');
       Params.Add('Database=C:\GHARARDAD.FDB');
       Params.Add('SQLDialect=3');

       LoginPrompt := False;
       ConnectionName := 'Gharardad';
       LibraryName := 'dbxfb.dll';
       VendorLib := 'C:\fbclient.dll'; // Renamed fbembed.dll to fbclient.dll
       GetDriverFunc := 'getSQLDriverInterBase'; 
       Connected := True;
     End;
    End;

My Operation sys is : Win 7 64 bit
And FB embedde ver is : Firebird-2.5.1.26351-0_Win32_embed

And my app Compiled on 32 bit

DLL Sizes :

 fbembed.dll  ----->  size    3,784,704 bytes

 dbxfb.dll     -----> size    288,768 bytes


But when i want to Run application, I get following Error:

DBX Error: Driver could not be properly. Client may be misiing, not installed properly, of the wrong version, or thr driver may be misiing from the system path.


What am I doing wrong?


Solution

  • I don't know why you use ConnectionName if you allready specify database User_Name Password.

    I would prefer something like this :

     Con := TSQLConnection.Create(Self); 
        With Con Do
         Begin
           Connected := False;
           DriverName := 'FirebirdConnection';      
           LibraryName := 'dbxfb.dll';
           VendorLib := 'fbembed.dll';
           ConnectionName := 'Gharardad';
           Params.Value['User_Name'] := 'SYSDBA';
           Params.Value['Password'] := 'masterkey';
           Params.Value['Database'] := 'C:\GHARARDAD.FDB';
           Connected := True;
         End;