1

On my development machine, I have Delphi 10.2 and Firebird 2.5. Database apps that I create in this configuration work correctly.

I copied one program along with its database to another computer running Windows 10. I installed Firebird; I also installed SQL Manager Lite for InterBase/Firebird on this computer, and this program is able to open the database and view the data contained within. But my Delphi program cannot open the database, displaying the error message 'Unable to load dbxfb.dll (error code 193). It may be missing from the system path'.

I have copied dbxfb.dll to every location that I can think of (the same directory as where the program is, the same directory as where the database is, windows\system32, C:\Program Files (x86)\Firebird, and more) but the message stays the same. On my development machine, what I believe to be the path (i.e. system properties\advanced\environment variables) contains only the directory %USERPROFILE%\AppData\Local\Microsoft\WindowsApps. On the other computer, I added C:\Program Files (x86)\Firebird but to no avail.

So where should dbxfb.dll be located, or how do I "tell" my program where to find it?

Edit: Regarding 'bitness', both computers are 64 bit. In the Project Options dialog box in Delphi, there is only the option of 32 bits. I've set the program's compatibility setting to Windows 8, but this made no difference regarding the missing dll.

Further edit: The version that is/was on the target machine is 1,412kb in size and dated 13/11/2015 1:55; this version apparently comes from C:\Program Files (x86)\Embarcadero\Studio\17.0\bin64, so this is definitely the wrong version.

In C:\Program Files (x86)\Embarcadero\Studio\17.0\bin, there is a version that is only 278kb in size, same date but hour 06:55. Copying the smaller file to the target machine and running the program gives now a different error message: i/o error during "@1" operation for file "@2". Error while trying to open file.

No'am Newman
  • 6,395
  • 5
  • 38
  • 50
  • The filename "dbxfb.dll" sounds like you are using the DBExpress components on your project. Is that correct? – MartynA Jan 22 '21 at 11:43
  • The file definitely does not belong in any Firebird directory. This is a library used by your application, not by Firebird. I have no knowledge of Delphi, but could this be a 64-bit application vs 32-bit library (or vice versa) problem? – Mark Rotteveel Jan 22 '21 at 11:53
  • @MartynA: Yes, dbExpress. This version is a port of the prior Delphi 7 version; I needed proper unicode support for Russian input/output. – No'am Newman Jan 22 '21 at 13:01
  • Make sure you have the correct one - where did you find it on the source system? Likely you copied a 64bit DLL instead of the needed 32bit DLL or vise versa. – Brian Jan 22 '21 at 13:02
  • I am not sure that your... XE3??? version behaves like that, but maybe there will be some inspiration for you. https://github.com/the-Arioch/XE2fixes/blob/master/dbx_FB_no_ini.pas – Arioch 'The Jan 22 '21 at 20:32
  • Also, No'am, Unicode is not needed for "Russian support", `Windows-1251` codepage does it. Unicode is needed if you want to support Russian AND some other extended language, like Greek, Spanish, Deutsch. If all you care for is Russian plus basic Latin (English with no extended character) then Delphi 5/7 can do just fine. Plus, there are TNT Unicode Controls for Delphi 7, granted that covers only stock VCL, and db-connection libs is another story. – Arioch 'The Jan 22 '21 at 20:36
  • `In the Project Options dialog box in Delphi, there is only the option of 32 bits.` you can right-click AFAIR (or something else noe hard to find) and add any other archtecture, like x64. Not that you would need it, just for the sake of completeness :-) – Arioch 'The Jan 22 '21 at 20:39
  • `i/o error during "@1" operation for file "@2". Error while trying to open file.` i would suspect this comes from Firebird, which was not installed fully can not find proper version of firebird.msg (matching fbclient.dll). But maybe the lacking file is some other error descriptions table. Anyway, use standard SysInternals Process Monitor tool to see which file i/o your applicati onwas generating last moments before the error was displayed and find the clues what the failure was – Arioch 'The Jan 22 '21 at 20:41
  • @Arioch'The: Re unicode - the program's main language is Hebrew, followed by English. Russian and French are additional required languages. I did use the TNT unicode controls, but one major stumbling block was the ability to save Russian text in an INI file. – No'am Newman Jan 23 '21 at 06:17
  • @No'amNewman by definition Windows .ini files are MBCS not Unicode. Making Unicode .ini might break compatibility with editors, other apps and maybe with Windows ProfileString API too. Why not use JSON or XML? There are plenty of record/object serialization libs for Delphi, starting with mORMot (JSON) and JediVCL(ini/registry/xml/DB) ? – Arioch 'The Jan 23 '21 at 13:19

1 Answers1

1

https://learn.microsoft.com/en-us/windows/win32/debug/system-error-codes--0-499-

ERROR_BAD_EXE_FORMAT

193 (0xC1)

%1 is not a valid Win32 application.

It is indeed the bitness problem as suggested by Mark.

user13964273
  • 1,012
  • 1
  • 4
  • 7
  • The error message is about a missing dll that is not 'on the path'. Why should the program work on one computer and not another when both are Windows 10 64 bit? – No'am Newman Jan 22 '21 at 13:07
  • @No'amNewman No, the error message doesn't say that the file is missing. It just says that it cannot be loaded. And code 193 is not for missing files. – Olivier Jan 22 '21 at 14:32
  • I'm going to mark this as the correct answer - my original problem was that I was linking against the wrong dll (64 bits as opposed to 32 bits). – No'am Newman Jan 23 '21 at 06:29