Question

I have a delphi project that somehow has become corrupted. I upgraded to Advantage 11.1 components (using XE) and now I'm getting the following error message when opening the project:

acctTbl: Error 5018: The handle given was not recognized by Advantage. Verify specified handle is open/active. The given handle is not recognized as a valid Advantage Client Engine

Because the error occurs, the data module DFM is not built, so I can't "adjust" any settings.

acctTbl is the first table in the DFM, so the error might occur for the ones following, but I can't tell.

We are not using the server, just the "Local Server".

I have tried to go back to version 10 of the components, but still the error continues.

I have also tried removing all of the projects object code and only opening the PAS and DFM files (by reverting from SVN).

Any help is greatly appreciated.

Was it helpful?

Solution

You can open the .dfm in a text editor (like Notepad), and change the AdsConnection.Connected property to false, and change any AdsTable or ADSQuery component's Active flags to false as well. (I'd suggest closing the IDE first, to make sure it doesn't cache a reference.) This will at least let you open the project and make whatever changes are needed to compile with the new version of ADS.

If the file has been updated through many older versions of Delphi prior to XE, there's a chance you still have a binary format .dfm file (meaning you'll see all kinds of strange symbols in Notepad when you open the .dfm file). If that's the case, Delphi includes a conversion utility (convert.exe, found in your $(DELPHI)\Bin folder), and you can use the following steps to convert it to text format and then make the changes (there's no need to convert it back after - the default is to create text .dfm files when new forms are created, and Delphi uses them very well as text).

Make a backup copy of your datamodule's .DFM somewhere safe first!

After making the backup copy, open a command window in your project folder, and run

Convert.exe -1 YourDataModule.dfm

The command says to convert in place (-i), which means the existing binary .dfm is overwritten by the new text .dfm (and the reason I stressed making a backup copy first). If you don't want to overwrite, you can omit the -i switch, and it will create a YourDataModule.txt file in the folder instead; you can then manually rename YourDataModule.dfm to a different name, and then rename YourDataModule.txt to YourDataModule.dfm.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top