3

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.

TLama
  • 75,147
  • 17
  • 214
  • 392
SysJames
  • 411
  • 3
  • 10

1 Answers1

3

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.

Ken White
  • 123,280
  • 14
  • 225
  • 444
  • Thanks for trying to help. I made the recommended changes to the DFM and received the same error error messages. All of our DFMs are in text. The "AdsConnection.Connected" line wasn't there, so I added it. I tried it with and without the added line. All the AdsTable active flages were changed to false. – SysJames Jan 28 '13 at 22:43
  • Then you have something opening an ADS connection or table that's not in the datamodule. ADS only uses a connection handle to either open a connection or a table or query. Search your project for other TADS components; something is trying to open an ADS connection or data dictionary, and you need to find it. :-) You might also check your datamodule's .pas file for anything in the initialization section that might be opening a connection. – Ken White Jan 28 '13 at 22:47
  • Thanks again for the response, but I still get the same error message. I uninstalled 11, deleted all 10 and 11 files, reinstalled 11 and checked the search pathes in the IDE, but still I get the error. I do appreciate your help. – SysJames Jan 28 '13 at 23:15
  • You said originally your project **started** demonstrating the problem when you upgraded to ADS v11, which means you should be reverting to v10 (the last **working** version). – Ken White Jan 28 '13 at 23:21
  • I Uninstalled version 11 and re-installed version 10. There was no difference in the error. – SysJames Jan 29 '13 at 07:54
  • You might have better luck posting this in the [ADS forums](http://devzone.advantagedatabase.com/forum). You can use the same credentials you logged in with here (OpenID or whatever) there as well, and the ADS support and development staff answer questions there. I'm not sure anyone can help here unless one of those employees happens to drop by. I've installed v11 on a machine that had previous versions installed and all worked fine, but I don't know exactly what you did or what might have happened during the install on your system. In any event, I don't know what else to tell you to try here. – Ken White Jan 29 '13 at 23:00
  • I did suggest making sure you removed **all** ADS related files from your system. That typically includes DLLs in the Windows\System32 folder, an ADS.INI file in the Windows folder (yes, yuck!), the TAdsDataSet installation folder (usually in Program Files\Sybase (or Extended Systems - I don't know if they changed that, and I don't install in Program Files so I can't check)). I'd remove every single ADS related file from my machine (including any compiled DCUs and BPL files), remove any ADS related paths from the IDE, and reboot my system, and then start over with v10. Anyway, good luck. :-) – Ken White Jan 29 '13 at 23:05
  • Oh, and delete any `.identcache` and `.local` files in your project folder. These are files used to speed up the compiler and Code Completion, and the IDE will regenerate them automatically on the next compile. You may have something orphaned there as well after you updated ADS. – Ken White Jan 29 '13 at 23:07
  • 1
    I found the error. It wasn't from the table component at all. It was from a component that we use that is descended from the Advantage table. The original reason for using the descendant has gone away, so now if I rebuild the data module with the native Advantage table component it will work. I don't know what is causing the issue with the descended component and I'm not going to take the time to find out since it is no longer needed. I really appreciate all the help and instruction. Thank you all very much. – SysJames Jan 30 '13 at 03:50