dbxfb not found when using firebird 2.5 - delphi

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.

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.

Related

Errors trying to install JCL in Delphi Alexandria

I am attempting to install the JCL library into Delphi RAD Studio 11. Git placed the jcl tree in my Users directory (say C:\Users\xxx); I followed instructions and made sure I updated the modules, etc.
I then attempted to execute the install.bat file, located in the C:\Users\xxx\jcl\jcl directory. When I did that I got a message to the effect that my version of RAD Studio/Delphi does not support command line compiling. That's fine, I simply opened the JDIInstaller.bdsproj (located in the C:\Users\xxx\jcl\jcl\installer folder) with RAD Studio and built it, successfully.
I then tried running the project from within RAD Studio, but I couldn't, I got an error message telling me to shut down all running instances of Delphi. Instead, I ran the EXE file directly from the C:\Users\xxx\jcl\jcl\bin folder; it ran to completion and said the installation finished. So far, so good. I should note that the JCL installer set the BPL path to C:\Users\Public\Documents\Embarcadero\Studio\22.0\Bpl and the DCP path to C:\Users\xxx\jcl\jcl\lib\d28\win32.
The issue is this: When I then go to open RAD Studio, I get a number of messages like below. The text of the error message is:
Can't load package C:\Users\Public\Documents\Embarcadero\Studio\22.0\Bpl\JclBaseExpert280.bpl.
The specified module could not be found.
Do you want to attempt to load this package the next time a package is loaded?
This dialog is repeated an additional six times (i.e. there are a total of seven messages). The file names are as follows (they all end with "Expert280.bpl", so I'm just giving the beginning part): Debug, FavoriteFolders, ProjectAnalysis, Repository, JCLSIMDView, JCLStackTraceViewer.
If I open Components->Install Packages in the RAD Studio IDE, the seven files appear in the Design Packages list, but unchecked. They all appear as "File C:\Users\Public\Documents\Embarcadero\Studio\22.0\Bpl" followed by the specific file name.
I checked, and the files exist in that location, but I know from my research that the message can be misleading; i.e., the message is returned by Windows which may be looking for a support file.
I don't know where to go from here.
I should note that previously I attempted to install JCL/JVCL into RAD Studio 2010 and initially got the same error message, but solved it by using a more recent version of JCL. However, there IS no more recent version of JCL that I can find.
Of course, it may be this cannot be done; i.e. install JCL/JVCL into Alexandria. Any information whether this is the case and, if not, what I might try would be appreciated.

running delphi application on non delphi pc

I'm building an application using delphi 7 with ms access 2007 as the database for a client. it runs normally on my laptop (asus) but after I copy the whole project folder and run the Project.exe, it gives me an error "Disk write error".
I've tried googling about "disk write error delphi application" but only found about I/O errors. my application only opens a file after a button click in a form that is called when I click on a submenu, so I'm guessing it's not about I/O..
what is the solution?
thanks in advance
P.S.:
in the project options, the checkbox for building application using runtime packages is already unchecked.
my PC and my client's PC are both using windows 7 32bit (I haven't actually confirmed this with him but I'm guessing he's also using 32bit version because he's not a techy guy)
his PC doesn't have delphi installed
UPDATE :
I forgot that the exact error message was "Disk or network error" instead of "Disk write error".
after googling for the correct error message, I've found out that the problem is that I use a full path for the DataSource in the ADOs' connection string. after I change connection string into "DataSource=.\db\my_db.mdb", the application works perfectly.
even though this question has a negative mark, I'll just leave this solution here in case someone needs it in the future...
Here are some different questions.
The "Disk write error" probably is that you need permissions to write in the folder. A simple test is that you execute your application with "admin permissions" to test this.
Different question is the "using runtime packages" check in project options.
If you compile your application with this check, you need to copy the BPL's needed for your application with the executable.
If you compile with this option unchecked, your exe file include all the libraries for execute (not included DLL's or external dependencies).

Debugging Dylibs from Delphi XEx (XE4)

Is it possible to debug Dylibs from Delphi, or is this functionality not included?
As I understand it, I should be able to:
1) Create a Host Application which loads up the Dylib that is deployed by Delphi
2) Set the "Host Application" in "Run -> Parameters..." to match this new application.
3) When firing up the debugger in Delphi, it should start the Host Application. The Host Application loads up the Delphi-generated Dylib. I should be able to hook onto an entry point from my Windows machine, and trace through the code.
Just like it works on Windows, but on a remote machine.
Unfortunately, Delphi does not seem to catch the execution of the Dylib at all. It is being loaded (and I've even gone out of my way to look through my entire machine to see if there were any other identically named Dylibs getting loaded by mistake), but Delphi takes no notice of the Dylib getting executed by the Host Process, and just waits for the Host to end.
Any solutions?
EDIT: I recently realized that XE4 can debug dylibs on Snow Leopard. So, load up an old version of OSX, if you've got one lying around.
Ok, here's the solution:
1) Switch over to Delphi XE5
1a) Wait for bitterness over upgrade price to subside. This may take a while. Consider waiting for XE6 to come out first.
2) XE5 Does track which libraries are loaded by an executable process, but it still fails to deploy the debugging symbols properly.
You will have to change a filename in your OSX output directory. This directory is located at "yourProjectFolder/OSX32/Debug". Build your project, and then rename "yourProject.rsm" to "yourProject.dylib.rsm". This is the name which Delphi is trying to deploy already, so you will not have to add the file to your Deployment Settings.
I'm hoping that there's a way to automate the renaming of this file (maybe the .dproj file can be hacked). If I can find one, I'll add it to this answer.
3) Goto 1a

Which problems exist when using 32bit applications that handle Office 2010 64bit files?

I am testing one application that handles files (stored in SQL Server using FILESTREAM). It is a Delphi 32bit application.
Opening an XLS document stored in the database (originally saved with Office 2003) gives an error from Excel 2010 64bit. Is there some known compatibility issue of Office 2010 64bit with 32bit applications?
Error messages and workflow
When opening the file Excel gives one of the following error messages:
Impossible to open the file FILE because of problems in contents
Impossible to open the file because some parts are missing or not valid
Opening a file on machine A with Office 2007 opens the file with no problems. Opening the same file on machine B with Office 2010 produces the error message. Opening again on machine A there is also an error message! In all these steps I am just reading from the database, not writing. So why does this can happen?
How do I open the documents?
SELECT query to get 'DOCUMENT' varbinary(max) field for the specific ID_Document.
Extract from database using
TBlobField(sqlQuery.FieldByName('DOCUMENT')).SaveToFile(sDestinationPath + FileUniqueName + .zip');
Copy file from one path to another using Windows.CopyFile
Unzip file using TZipforge component
Set attribute of unzipped file to ROM using FileSetReadOnly function.
Open document using ShellExecute(0, 'open', PWideChar(FIleName), '', '', SW_SHOWNORMAL);
As you can see there is nothing that writes back to the database. Once the file is extracted from TBlobField it is even copied to another place before unzipping and opening it.
Possibly broken installation
Office has been reinstalled and now everything works, the problem of corruption was due to a conflict with an open Office installation that asked "do you want to fix the office installation?". Anyway the problem still remains, because I cannot understand what happened. How can I corrupt a file in the database if I extract it in a folder and open it from the folder without writing anything back to database?
Office 2010 64-bit should have no problems with files created with its 32-bit version. The files (.docx, .xls) are bitness independant.
I have some questions:
How do you open your files?
Can you show some code?
Are you sure that you are only reading the file from the database?
Do you give your files the right extension? Saving a .xls as .xlsx will cause problems when opening the file.
Check if your SQL server database is corrupt. Check disk where database is for errors. Reinstall SQL server.
Solved: it was a bug in my program. There was an error in the logic that persisted the document status and by mistake sometimes Is_File_Compressed was set to False, even if it is true.
Thanks for the support.

How to have, Delphi source code visible during remote debugging with Delphi 2010

I'm starting with the Delphi 2010 remote debugger. There is some good information here and I can start and execute my program on the remote machine. I can't get Delphi to step through my source code though, despite the fact that when run locally, all works fine. All I get is the CPU view and any breakpoints I set get shown disabled when I start the program. My target machine has my exe file together with rsm and map files just built.
My source paths are declared relative to the project i.e
....\Source\MyFiles
but this should stand whilst debugging should it not?
I had a similar issue and found this web site very useful. http://delphi.wikia.com/wiki/Remote_Debugger
The first section "Using the Remote Debugger with Delphi 2010" contains a link to an updated version of the remotedbg140 application that fixed the problem for me.
Did you copy the .rsm file to the target too ?
The relative paths should be ok if it compiles (then the working dir is ok), at least it is working for me with D2009.
(about working dir: see Delphi debug a wrong unit )

Resources