Delphi 2010: Firebird dbExpress Error Unable to load dbxfb4d14.dll - delphi

I just downloaded the dbExpress Driver for Firebird by Chee-Yang Chau from this google code site.
I loaded the Delphi 2010 demo projects and tried running it and immediatedly got a could not load dll error:
INI File
[Installed Drivers]
FirebirdConnection=1
[FirebirdConnection]
;DriverUnit=DBXInterBase
;DriverPackageLoader=TDBXDynalinkDriverLoader,DbxCommonDriver120.bpl
;DriverAssemblyLoader=Borland.Data.TDBXDynalinkDriverLoader,Borland.Data.DbxCommonDriver,Version=12.0.0.0,Culture=neutral,PublicKeyToken=91d62ebb5b0d1b1b
;MetaDataPackageLoader=TDBXInterbaseMetaDataCommandFactory,DbxInterBaseDriver120.bpl
;MetaDataAssemblyLoader=Borland.Data.TDBXInterbaseMetaDataCommandFactory,Borland.Data.DbxInterBaseDriver,Version=12.0.0.0,Culture=neutral,PublicKeyToken=91d62ebb5b0d1b1b
GetDriverFunc=getSQLDriverFIREBIRD
LibraryName=dbxfb4d14.dll
VendorLib=C:\Program Files\Firebird\Firebird_1_5\bin\fbclient.dll
BlobSize=-1
CommitRetain=False
Database=database.gdb
ErrorResourceFile=
LocaleCode=0000
Password=masterkey
RoleName=RoleName
ServerCharSet=
SQLDialect=3
Interbase TransIsolation=ReadCommited
User_Name=sysdba
WaitOnLocks=True
Trim Char=False
Delphi Code
procedure TMainForm.Button1Click(Sender: TObject);
var C: TSQLConnection;
begin
C := TSQLConnection.Create(Self);
try
C.DriverName := 'FirebirdConnection';
// C.LibraryName := 'dbxufb40.dll';
// C.VendorLib := 'C:\Program Files\Firebird\Firebird_1_5\bin\fbclient.dll';
// C.GetDriverFunc := 'getSQLDriverFIREBIRD';
C.Params.Add('User_Name=SYSDBA');
C.Params.Add('Password=masterkey');
C.Params.Add('Database=localhost:%ProgramFiles%\Firebird\Firebird_1_5\examples\employee.fdb');
C.Open;
if C.Connected then
ShowMessage('Connection is active')
finally
C.Free;
end;
end;
I noticed that the library name dbxfb4d14.dll in the ini file did not match the actual dll name dbxfb4d15.dll so I modified the ini file so it would match the name of the dll.
Now I get an error saying the dbxfb4d15.dll cannot be found.
What am I doing wrong?

You do need the d14 version for Delphi 2010. The d15 version is for XE. Not sure why there is only the d15 version in the zip.
The DLL is not located on your DLL search path. Once you get hold of the right DLL then you need to make sure it's on the path.
Having browsed around this component I'm not convinced it's terribly polished. If you can afford it, the Devart drivers come highly recommended.

Related

Could not load SSL library - dll not found

In my Delphi (10.3 community edition) program, I try to use Indy with the OpenSSL library, but I receive an error
Could not load SSL library
My OpenSSL library is version 1.0.2u and I put the libeay32.dll and ssleay32.dll files in my program EXE directory, and in Windows\SYSWOW64 and Windows\System32.
I have installed the Embarcadero Delphi Patch RS1033_Indy_SSL_Patch.
After the exception, I call WhichFailedToLoad() and the result is
Failed to load libeay32.dll
This is a simple program that raises the exception:
url := 'https://www.google.it';
try
Web := TIdHTTP.Create(nil);
hIOHand := TIdSSLIOHandlerSocketOpenSSL.Create(nil);
hIOHand.SSLOptions.SSLVersions := [sslvTLSv1,sslvTLSv1_1,sslvTLSv1_2,sslvSSLv23];
Web.IOHandler := hIOHand;
Web.Request.UserAgent := INET_USERAGENT; //Custom user agent string
Web.RedirectMaximum := INET_REDIRECT_MAX; //Maximum redirects
Web.HandleRedirects := INET_REDIRECT_MAX <> 0; //Handle redirects
Web.ReadTimeOut := INET_TIMEOUT_SECS * 1000; //Read timeout msec
try
Sito := Web.Get(Url);
Sito := DateToStr(Web.Response.LastModified) + Sito;
except
on e : exception do
stg := WhichFailedToLoad();
end;
finally
Web.Free;
end;
Can you help me to solve the problem?
I put the libeay32.dll and ssleay32.dll files in my program EXE directory
That is fine. That is the 1st place the OS will look for them.
and in Windows\SYSWOW64 and in Windows\System32
Don't do that! Non-system files do not belong there. ESPECIALLY if you are putting the same files in both folders, since Windows\SYSWOW64 is meant only for 32bit files and Windows\System32 is meant only for 64bit files.
Failed to load libeay32.dll
That means Windows could not load that DLL into memory at all. Probably because it couldn't find the dependent ssleay32.dll file, but more likely because you mixed up the 32bit and 64bit versions of the DLLs. If your app is compiled as a 32bit EXE, you must use the 32bit version of both DLLs. If your app is compiled as a 64bit EXE, you must use the 64bit version of both DLLs.

Why the compiler is unable to load the library name dbexpint.dll?

I'm a new user o Delphi 10.2 Tokyo (trial version) when I compile the program source code this error message appears:
Unable to load dbexpint.dll (ErrorCode 126). It may be missing from the system path.
This code should access a Firebird database, I have Firebird Client 3.0 installed on my machine. inside the installation folder I have the DLLs:
FBCLIENT.DLL
MSVCP100.DLL
MSVCR100.DLL
Below is part of the source code.
unit uDataModule;
interface
uses
SysUtils, Classes, DBXCommon, DB, DBClient, SimpleDS, SqlExpr, FMTBcd,
ADODB, Data.DBXInterBase, Data.DBXOracle;
...
procedure TDM.DataModuleCreate(Sender: TObject);
var
strPath: String;
begin
//Conex?o Firebird SPIRIDON
SQLSpiridonConnection.Params.Clear;
SQLSpiridonConnection.Params.Values['DatabaseServer'] := 'Interbase';
SQLSpiridonConnection.Params.Values['Database'] := 'XXXXXXXXXX:f:\dados\database\XXXXXXXXXXXX.FDB';
SQLSpiridonConnection.Params.Values['SQLDialect'] := '3';
SQLSpiridonConnection.Params.Values['DriverName'] := 'Interbase';
SQLSpiridonConnection.Params.Values['VendorLib'] := 'gds32.dll';
SQLSpiridonConnection.Params.Values['User_Name'] := 'XXXXXXXX';
SQLSpiridonConnection.Params.Values['Password'] := 'XXXXXXXX';
SQLSpiridonConnection.Params.Values['LibraryName'] := 'dbexpint.dll';
SQLSpiridonConnection.Params.Values['GetDriverFunc'] :=
'getSQLDriverINTERBASE';
SQLSpiridonConnection.Connected:= True;
I tried to download the DLL and put it in the system32 and wow64 folders, but it was not effective.
I tried changing the reference from the Library name line to dbxint.dll, but the following error appears:
DBX Error: Driver could not be properly initialized. Client library may be missing, not installed properly, of the wrong version, or the driver may be missing from the system path.
I don't know what's wrong and how I can solve it. Please, can you guys help me?
dbexpint.dll is the dbExpress Interbase driver for (old) Delphi versions from Delphi 6 to Delphi 2005. It could also be used to connect with Firebird databases, while newer Delphi versions use separate drivers for each one.
This driver is not compatible with Delphi versions 2006 and later. Instead, Delphi 10.2 now uses dbxint.dll for Interbase, and dbxfb.dll for Firebird.
The params of dbxfb.dll are similar to that of dbexpint.dll.
If you create a new form, drop a TSQLConnection on it and select FBConnection as the value of the ConnectionName property, then the Driver property will automatically be assigned with the needed value Firebird, and the Params property will also be populated with suitable values:
object SQLConnection1: TSQLConnection
ConnectionName = 'FBConnection'
DriverName = 'Firebird'
Params.Strings = (
'DriverName=Firebird'
'Database=database.fdb'
'RoleName=RoleName'
'User_Name=sysdba'
'Password=masterkey'
'ServerCharSet='
'SQLDialect=3'
'ErrorResourceFile='
'LocaleCode=0000'
'BlobSize=-1'
'CommitRetain=False'
'WaitOnLocks=True'
'IsolationLevel=ReadCommitted'
'Trim Char=False')
Left = 312
Top = 172
end
Note: As mentioned by #DavidHeffernan in the comments, don't put DLLs into system directories. Better put it in the same folder as your exe file.
Thanks guys for the help.
I found a way to fix the error:
Actually the dbexpint.dll driver only worked on the older versions of Delphi. The current driver is dbxfb.dll for connections to the Firebird database.
Firstly I changed the lines of code as below.
SQLSpiridonConnection.Params.Clear;
SQLSpiridonConnection.Params.Values['DatabaseServer'] := 'Firebird';
SQLSpiridonConnection.Params.Values['Database'] := 'xxxxxxxxxxxxx:f:\dados\database\xxxxxxxxxx.FDB';
SQLSpiridonConnection.Params.Values['SQLDialect'] := '3';
SQLSpiridonConnection.Params.Values['DriverName'] := 'Firebird';
SQLSpiridonConnection.Params.Values['VendorLib'] := 'fbclient.dll';
SQLSpiridonConnection.Params.Values['User_Name'] := 'SYSDBA';
SQLSpiridonConnection.Params.Values['Password'] := 'xxxxxxx';
SQLSpiridonConnection.Params.Values['LibraryName'] := 'dbxfb.dll';
SQLSpiridonConnection.Params.Values['GetDriverFunc'] := 'getSQLDriverINTERBASE';
SQLSpiridonConnection.Connected:= True;
After that I inserted these dlls into the Firebird installation folder.
borlndmm.dll
dbxfb.dll
midas.dll
fbclient.dll this dll is already installed in the folder
The other dlls are inside the delphi installation folder.
Ex: C: \ Program Files (x86) \ Embarcadero \ Studio \ 19.0 \ bin
OBS: #DavidHeffernan Yes I did already asked this question, thanks for your comment

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?
You need specify Database parameter like this:
Params.Add('Database=C:\Full\Path\GHARARDAD.FDB');
I see you want to use embedded version, you need to use fbembed.dll insead of fbclient.dll
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;
Do u have any other connections open to that database ?
FlameRobin, IBExpert, Delphi IDE Form Designer ?
Do you have any active datasets/connections in Delphi ?
Embedded requires non-shareable opening of file.
Run SysInternals Process Explorer and do search for your database file if it is already open by some another application
Do u really use weirdly renamed firebird embedded and not firebird client ?
#Marcodor and #Re0sless already asked you that.
It seems that you only think you're using embedded but u only have small share of server installed without main engine.
fbembed.dll 2.5.1 Win32 size is 3 784 704 bytes
fbclient.dll 2.5.1 Win64 size is 870 912 bytes
fbclient.dll 2.5.1 Win32 size is 548 864 bytes
Which is yours DLL ?
This can also be that database engine version and database file version do not match. Try SysInternals Process Monitor to see which files does your application try to find and open. Does it succesfully open the db files ? does it successfully find and open firebird.msg ? does it succesfully open icu*.dll ? maybe udf dlls ?
Is there some error written into firebird.log ?
In general - learn to use SysInternals Process Monitor to know what files and where were tried. It very frequently would hint you what error happened exactly and why.
You did not listed fbintl.dll
If your database containst non-Latin letters and non-English language, then it might be unable to open it without properly located fbintl. Check in Process Monitor where it is searched for and put there.
check in Process Monitor which firebird dll version your application actually loads. Is its version new enough to open that database ?
You said your using Firebird embedded but you are using the standard firebird VendorLib
VendorLib := 'fbclient.dll';
For embedded firebird this should be
VendorLib = '[pathtolib]\fbembed.dll'
You are also missing the value for GetDriverFunc
So the complete TSQLConnection object would looks like so (tested in Delphi 2007)
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');
//other connection params here
ConnectionName := 'Gharardad';
LibraryName := 'dbxfb.dll';
VendorLib := 'C:\fbembed.dll';
GetDriverFunc = 'getSQLDriverInterBase' //Or what ever the dbxfb.dll function is called
Connected := True;
End;
End;
Note that the getSQLDriverInterBase function is the name of the function from the Devart firebird library so it may differ in the dbxfb.dll library.

reading SVN:externals from working copy

Until recently it was simple to read all the SVN:Externals referenced in a subversion working copy by just reading some text files stored in the .svn subdirectory. With the change to a new on disk structure using mysql tables this is no longer that simple.
I want to update an internally used tool that used to read that list of externals to using the new structure. The Tool is written in Delphi 2007 so I would prefer some code written in Delphi.
There is Version Insight for RAD Studio on sourceforge which might contain some code to do the trick but I wonder if any body else has maybe already gone through the work of extracting the required parts from that project or has an alternative.
You can also do it programmatically, using the Subversion client DLLs. Here is a minimal example written in Delphi XE:
program svnext;
{$APPTYPE CONSOLE}
uses
SysUtils,
SvnClient;
procedure Main;
var
SvnClient: TSvnClient;
SvnItem: TSvnItem;
begin
// Subversion client DLL directory; here I simply use the .exe's directory
// (I copied the DLLs there manually.)
BaseDllDir := ExtractFilePath(ParamStr(0));
SvnClient := nil;
SvnItem := nil;
try
SvnClient := TSvnClient.Create;
SvnClient.Initialize;
SvnItem := TSvnItem.Create(SvnClient, nil, ParamStr(1));
Writeln(SvnItem.PropValues['svn:externals']);
finally
SvnItem.Free;
SvnClient.Free;
end;
end;
begin
try
Main;
except
on E: Exception do
begin
ExitCode := 1;
Writeln(Format('[%s] %s', [E.ClassName, E.Message]));
end;
end;
end.
You might have to tweak the code for Delphi 2007. It seems Version Insight has evolved in the meantime and lost (some of) the backward compatibility.
If you can call the svn executable, it is pretty easy to find all the externals stored in your repository :
svn propget -R svn:externals .
will return :
first/path/to/external - name_of_first_external http://first_repos/that/is/in/external
second/path/to/external - name_of_second_external http://second_repos/that/is/in/external
Like others said, call the SVN executable. You can integrate this with the Delphi Tools menu using this technique:
http://delphi.wikia.com/wiki/Adding_TortoiseSVN_to_the_Tools_menu
To add to that article, it's also VERY handy to have an "open folder here" entry that opens Windows Explorer for the folder of the file being edited. Here's the "tool properties" for that:
Title: Open Folder Here
Program: explorer.exe
Parameters: $PATH($EDNAME)
If you have this, then you've got all of TortoiseSVN at your fingertips.

How to connect in a firebird database in execution time?

I'm having a hard time to make my code work. I want to connect to a database with my application in Delphi 7, but if I change the folder of the application, for example, if I install in another computer, my datamodule stops working. The error is:
Raised exception class EdatabaseError with message "Missing Drivername propriety"
My actual code is:
procedure TDataModule1.DataModuleCreate(Sender: TObject);
var
conexao : TSQLConnection;
begin
with SQLConnection1 do
begin
ConnectionName := 'SKY';
DriverName := 'Interbase';
LibraryName := 'dbexpint.dll';
VendorLib := 'gds32.dll';
GetDriverFunc := 'getSQLDriverINTERBASE';
LoadParamsOnConnect := true;
LoginPrompt := False;
Params.Add('Database='+ExtractFilePath(Application.ExeName)+'\Banco\FLY_SKY_DESK.FDB');
Params.Add('User_Name=SYSDBA');
params.Add('Password=masterkey');
Params.Add('SQLDialect=3');
Open;
end;
SQLConnection1.Connected:=true;
end;
I want to connect to the database using my .exe, on any path or install location.
If you are running Windows 7 or Vista, and install your app into the "\Program files" (either one) directory, this will not work due to folder virtualization within UAC.
You should NOT attempt to place the database within the same directory that the program is running from. You will get away with it on XP and earlier. From then on, it's a no-no.
This may not be your problem, but it definitely IS a problem.
I faced a similar problem when I tried to write code which would open a Firebird database from a thread. The code looks like you are using the dbExpress TSQLConnection; it's much easier if you use the IB components, specifically TIBDatabase. Then your code becomes something like the following
var
ibdb: TIBDatabase;
qDefaults: TIBQuery;
trans: TIBTransaction;
begin
ibdb:= TIBDatabase.Create (nil);
ibdb.databasename:= ExtractFilePath(Application.ExeName)+'\Banco\FLY_SKY_DESK.FDB')
ibdb.loginprompt:= false;
ibdb.params.add ('password=masterkey');
ibdb.params.add ('user_name=sysdba');
ibdb.sqldialect:= 3;
ibdb.connected:= true;
trans:= TIBTransaction.create (nil);
trans.defaultdatabase:= ibdb;
qDefaults:= TIBQuery.create (nil);
qDefaults.database:= ibdb;
qDefaults.transaction:= trans;
qDefaults.sql.Add ('select * from defaults');
qDefaults.active:= true;
...
You are most likely missing the DLLs required on the target computer. You'll need to figure out which DLLs should be included with the client application and install them on the target computer. Often, simply placing the required DLLs in the same folder as the EXE will work.
I can't figure out quite what you're using since you reference Interbase and dbExpress and Firebird, but your target computer probably doesn't have the needed drivers.
You need to deploy:
dbxconnections.ini
dbxdrivers.ini
dbxfb.dll
fbclient.dll
midas.dll {in case you used ClientDatasSet and you didn't include MidasLib into uses clause}
after deploy all those files along with your Exe than you need to update registry entry to point to locations of dbxconnections.ini and dbxdrivers.ini my version is delphi 10.3 so the registry entry are located in
HKEY_CURRENT_USER > Software > Embarcadero > BDS > 20.0 > DBExpress
Connection Registry File value is the path to dbxconnections.ini
Driver Registry File value is the path to dbxdrivers.ini

Resources