Question

I have a set of tables that were included in an Advantage Database data dictionary. The dictionary is no longer available, and the tables will not open.

I would like to free those tables using code (not the Advantage Data Architect).

The only reference I can find to this is a function listed in the help called ADSDDFreeTable.

The documentation for the function is at this link:

http://devzone.advantagedatabase.com/dz/WebHelp/Advantage11.1/index.html?ace_adsddfreetable.htm

but it does not offer a code sample, and I cannot understand how to use it.

Would anyone be kind enough to show a code sample of how this function is used (with variables, not literals, for file names, etc)

Thanks very much!

Was it helpful?

Solution

Ace.pas defines AdsDDFreeTable as

function AdsDDFreeTable( pucTableName: PAceChar;
                         pucPassword: PAceChar ):UNSIGNED32; {$IFDEF WIN32}stdcall;{$ENDIF}{$IFDEF LINUX}cdecl;{$ENDIF}

The same Ace.pas defines PAceChar:

type
  PAceChar = PAnsiChar;

Therefore, the call to the function should be fairly straightforward:

var
  TableName: AnsiString;
begin
  TableName := 'C:\Data\MyTable.adt`;
  if AdsDDFreeTable(PAnsiChar(TableName), nil) <> ADS_FREETABLEFAILED then
    ShowMessage('Table removed from datadictionary')
  else
    // Call ADSGetLastError to retrieve reason for failure;
end;

OTHER TIPS

In addition to @Ken's solution (+1), there is also a standalone command line utility named freeadt.exe that will free ADT tables from their associated data dictionary. I believe it is installed with Advantage Data Architect.

If you run it from the command line with no parameters, it displays usage information. In general, though, you can give it a folder name (to process all the tables) or a specific file as a parameter.

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