I cannot get firebird embedded server to work.
Get an exception at line
datamodule1.IBQuery1.Prepare;
".exe raised exeption class EIBClientError with message 'Database name is missing'."
(IBQuery1 is tied to IBDatabase1)
Im using the server/client dll from this package:
Firebird-2.5.3.26778-0_Win32_embed.zip (x86)
I copied the following files (as written in the firebird manual) to my application's folder:
ib_util.dll
icudt30.dll
icuin30.dll
icuuc30.dll
fbembed.dll
firebird.msg
('firebird.conf' does not have to be copied in case you are ok with firebirds default configuration.)
I renamed the fbembed.dll to gds32.dll because im using Delphi's interbase components, but tried the file names fbclient.dll and fbembed.dll also.
For IBDatabase1's 'DatabaseName' property i dont use hostname bacause its stated in the manual that you dont have to in case of using the embedded server (local XNET protocol).
I create the path in runtime, been debug this and double checked the path, its correct.
At design time i can connect to the database setting the IBDatabase1's 'Connected' parameter to 'True'. (After manually filling the 'DatabaseName' property with the correct path.)
I searched the system for other firebird client dll's (gds32.dll) and found it at four different location:
c:\Program Files (x86)\HK-Software\IBExpertLive\gds32.dll
c:\Windows\System32\gds32.dll
c:\Windows\SysWOW64\gds32.dll
c:\InCash\GDS32.DLL
It seems that the system using the one that is located in SysWOW64, but even if i replace the dll there to the embedded (fbembed.dll renamed to gds32.dll), nothing changes.
The goal would be not to touch any of the already installed dlls and environment variables/registry entries, but using the embedded dll that is bundled with my application and is located beside that, so making the deployment of the software as easy as you can get.
Some more info:
Tried to rename database XYZ.FDB to XYZ.GDB
Username and password is given at IBDatabase1's 'Params' property although its not necessary with the embedded version
Op. system: Win7 x64
I have a firebird service installed, but its been stoped
Im using Delphi's InterBase components
Datamodule1.IBQuery1 is tied to Datamodule1.IBDatabase1
The DatabaseName property of IBDatabase1 been set to 'e:\X\XYZ.FDB' by code (the path is correct, i double checked)
IDE: Delphi 2010
Was searching for similar topics but yet i could not find solution.
Connect to database:
procedure TDataModule1.DataModuleCreate(Sender: TObject);
begin
IBDatabase1 := TIBDatabase.Create(self);
//
app_path := ExtractFilePath(Application.ExeName);
//
IBDatabase1.DatabaseName := app_path + 'db\XYZ.GDB';
IBDatabase1.LoginPrompt := false;
IBDatabase1.Params.add('lc_ctype=UTF8');
IBDatabase1.Params.add('user_name=xyz'); //not necessary with embedded
IBDatabase1.Params.add('password=xyz'); //not necessary with embedded
//
IBDatabase1.Connected := true;
IBDatabase1.Open;
end;
Then trying to insert a record:
with datamodule1.IBQuery1 do
begin
close;
With SQL do
begin
clear;
Add( 'INSERT INTO MST_EVENTS (index, state, event, param, date, time, devID, gateway)' );
Add( 'VALUES :index, :state, :event, :param, :date, :time, :devid, :gateway');
end;
//
Params[0].AsInteger := FMaster.EventRecordIndex;
Params[1].AsSmallInt := FMaster.EventRecordState;
Params[2].AsString := eventToStr(FMaster.EventRecordEvent);
Params[3].AsSmallInt := 0;
Params[4].AsDate := FMaster.EventRecordDate;
Params[5].AsTime := FMaster.EventRecordTime;
Params[6].AsLongWord := FMaster.EventRecordDevID;
Params[7].AsString := FMaster.EventRecordIP;
//
if ( prepared = false ) then
prepare; //Throws the exception here
open;
end;
This line was the problem.
IBDatabase1 := TIBDatabase.Create(self);
It's totally needless, because the class instance had already been created by the datamodule 'form'.
Related
I have developed an application that uses RAD Server over IIS. So far I have successfully created my Server and client applications. The app provides some information that needs to be verified against a MSSQL database on the Server Side. Everything works fine in a test environment as my Database Connection parameters are set in my FDConnection component.
However, I would like to change the Connection parameters by reading an ini file when the Server is accessed.
On my development system I can place the ini file in the directory where my bpl output is located. (ie. C:\Users\Username\Projects\Application\Server\Win32\Debug). The server then reads the ini file correctly and updates the component parameters.
I have created the directories on the server in accordance with the RAD Server documentation and have placed the required EMS files in the directory. (ie: C:\inetpub\RADServer\EMSServer) Since this is where the emsserver.ini file resides, I thought this would be the correct place to put my ini file. If I launch the EMSDevServer.exe from this directory, the ini file gets read properly and FDConnection parameters get updated.
However, when I launch the RAD Server through IIS using the ISAPI dlls, it appears the ini file is not found as my database connections fail.
I have tried putting the ini file in the C:\Users\Public\Documents\Embarcadero\EMS directory and that did not work either.
Following is my code to access the ini file which is called on DataModuleCreate.
procedure TdmSecurity.DataModuleCreate(Sender: TObject);
begin
SetConnectionStr(FDConnectionSTIKS);
end;
procedure SetConnectionStr(var FDConnectionSTIKS: TFDConnection);
var ConfigIni: TInifile;
DBServerName, DBName, Path: string;
begin
Path := GetCurrentDir;
ConfigIni := TIniFile.Create(System.IOUtils.TPath.Combine(Path, 'Config.ini'));
// ConfigIni := TIniFile.Create(System.IOUtils.TPath.Combine(System.IOUtils.TPath.GetDocumentsPath, 'Config.ini'));
// ConfigIni := TIniFile.Create('C:\Users\leonard\Projects\LumberNowEMS\Server\Win32\Debug\config.ini');
DBServerName := ConfigIni.ReadString(AppNode, 'ServerName', 'ZEUS');
DBName := ConfigIni.ReadString(AppNode, 'DataBase', 'NOTHING');
// showmessage(configini.FileName);
with FDConnectionSTIKS.Params as TFDPhysMSSQLConnectionDefParams do
begin
DriverID := 'MSSQL';
Server := DBServerName;
Database := DBName;
UserName := DBUserID;
Password := DBPassword;
end;
ConfigIni.Free;
// showmessage(Path + '; DBName:' +DBName);
// Result := Format('DriverID=MSSQL;Server=%s;Database=%s;User_name=%s;Password=%s', [DBServerName, DBName, DBUserID, DBPassword]);
end;
I expected that the IIS would read the ini file from the same place but it does not appear to be so. Can someone tell me where I should put the ini file so IIS can access it correctly or perhaps a better way of setting the database connection in Rad Server? Perhaps I could put my parameters in the emsserver.ini if there is a variable I can access.
#nolaspeaker - I would give you credit for the answer but you only posted a comment. Your response prompted me to find a way to determine the path that was being used. So I wrote the value of the path variable to a known text file.
Path := GetCurrentDir;
AssignFile(F, 'C:\Temp\Data.txt');
Rewrite(F);
WriteLn(F, Path);
CloseFile(F);
The path that is being used is 'C:\Windows\SysWOW64\inetsrv';
I moved my Config.ini file to this directory and it was found and read correctly.
Thanks for the responses.
Quite late, still posting an answer.
Functions in System.SysUtils will be helpful here.
following function call would give you the path to the directory where the .bpl file resides.
ExtractFilePath(GetModuleName(HInstance));
place the ini along with .bpl file, combining the above function's result with the Ini filename will help you to target an ini.
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
Hello fellow StackOverflowers,
Currently I'm facing a situation where it seems that there is a maximum length for the Database property of a TSQLConnection object in Delphi.
When I open the connection to my database I get the following error when I use a rather long (154 chars) database name:
dbExpress Error: [0x0015]: Connection failed
SQL Server Error: unrecognized database parameter block
wrong version of database parameter block
When I relocate my database file to another location (and with that reduce the length of the path) it will connect to the database.
I am currently using the Object Inspector to set the connection properties of the TSQLConnection object.
Basically, my question comes down to this:
Does a TSQLConnection have a maximum length for the values set in the Params property? And if so, what is the maximum length of these values?
Update
I've found two ways to open a copy of Employee.Gdb in a folder with a 160-character name ('abcdefghij0123456789' x 8).
What I did firstly was to edit the DBXConnections.Ini file and changed the Database parameter in the [IBConnection] section to read
Database=localhost:D:\abcdefghij01234567890abcdefghij01234567890abcdefghij01234567890abcdefghij01234567890abcdefghij01234567890abcdefghij01234567890abcdefghij01234567890abcdefghij01234567890\employee.gdb
Then, I can successfully connect to it, open the Employee.Gdb and make changes to the Customer table. I have verified the changes in IBConsole just in case the copy of Employee.Gdb wasn't the one I assumed it was.
Subsequently, I've found that I can create and open the db in code using Delphi Seattle and Interbase XE7, as follows:
function LongPath : String;
begin
Result := 'D:\' + DupeString('abcdefghij0123456789', 8);
end;
function LongDBName : String;
begin
Result := LongPath + '\Employee.Gdb';
end;
procedure TForm1.OpenDB;
var
Ini : TMemIniFile;
const
scDBXConIni = 'C:\Users\Public\Documents\Embarcadero\Studio\dbExpress\17.0\dbxconnections.ini';
scSourceDB = 'D:\Delphi\Databases\Interbase\Employee.Gdb';
begin
Ini := TMemIniFile.Create(scDBXConIni);
try
// First, blank out the Database value in the IBConnection section
// of DBXConnections.Ini
Ini.WriteString('IBConnection', 'Database', '');
Ini.UpdateFile;
// Next, create the long-named directory and copy Employee.Gdb to it
if not DirectoryExists(LongPath) then
MkDir(LongPath);
Assert(CopyFile(PChar(scSourceDB), PChar(LongDBName), False));
// Set LoadParamsOnConnect to False so that the SqlConnection uses
// the value of the Database we are about to give it
SqlConnection1.LoadParamsOnConnect := False;
SqlConnection1.Params.Values['Database'] := LongDBName;
SqlConnection1.Connected := True;
// Open the CDS to view the data
CDS1.Open;
finally
Ini.Free;
end;
end;
The critical step in doing it this way is setting LoadParamsOnConnect to False, which I confess I'd overlooked in earlier attempts to get this code to work.
I've got some earlier versions of Delphi on this machine, so if you're not using Seattle and the above code doesn't work for you, tell me which one you are using and I'll see if I can try that.
**[Original answer]
Actually, I think that this may be an error occurring in one of the DBX DLLs.
I created a folder with a 160-character name, then copied the demo Employee.Gdb database into it. Interbase XE7's IBConsole can open the db without error. So could a small test project contructed with IBX components in Delphi Seattle.
However, with an equivalent DBX project, when I use the code below
procedure TForm1.Button1Click(Sender: TObject);
begin
SqlConnection1.Params.Values['database'] := 'D:\abcdefghij01234567890abcdefghij01234567890abcdefghij01234567890abcdefghij01234567890abcdefghij01234567890abcdefghij01234567890abcdefghij01234567890abcdefghij01234567890\employee.gdb';
SqlConnection1.Connected := True;
end;
I get an error in
procedure TDBXDynalinkConnection.DerivedOpen;
var
Count: TInt32;
Names: TWideStringArray;
Values: TWideStringArray;
IsolationLevel: Longint;
DBXError: TDBXErrorCode;
begin
Count := FConnectionProperties.Properties.Count;
FConnectionProperties.GetLists(Names, Values);
CheckResult(FMethodTable.FDBXConnection_Connect(FConnectionHandle, Count, Names, Values));
DBXError := FMethodTable.FDBXConnection_GetIsolation(FConnectionHandle, IsolationLevel);
'I/O error for file "database.gdb"
Error while trying to open file
The operation completed successfully'
and the Database param of the SqlConnection is left at the value 'Database.Gdb', which is not the value I specified, of course, nor was it the value specified in the params in the IDE, which was 'd:\delphi\databases\interbase\employee.gdb'.
I wondered if I could work around this problem by SUBSTing a drive to the 'abcdefg ...' path. I tried that and opening the database as "x:\employee.gdb" , but I get the same error in my DBX app, and also IBConsole cannot access the db either.
I think you need a shorter physical path!**
This is related to MSSql Server:
As a general guideline, long path names greater than 160 characters
might cause problems.
from Microsoft TechNet - https://technet.microsoft.com/en-us/library/ms165768(v=sql.105).aspx
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.
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