'Advantage' table type and FieldDefs property
Is there any way to get a '*.ADT' table type to accept a call
to ".FieldDefs.Update" ? this seems to cause a crash at runtime.
A table of 'Tadstable' is not the sole problem but only when
".TableType" is set to "ttAdsADT" is there a bug with
'Tadstable' type? or is there some trick to get this to work?
the help files simply say 'Identical to Borlands TTable property'
hummmm...
I am writting a component similar to Peter's 'AdsDesignTable'
but works with '*.DBF' files as well as '*.ADT' (based mostly
on SQL for field additions/subtraction/modifications)
///////////
ftableB : Tadstable;
fAdsSett : TAdsSettings;
//////////////
function TpsDBAssert.SetTableType(var t:Tadstable;
pathAndName:String):Boolean;
...
if Uppercase(ExtractFileExt(fTableBName)) = '.DBF' then
ftableB.TableType := ttAdsNTX
else if Length(ExtractFileExt(fTableBName))= 0 then
ftableB.TableType := ttAdsCDX
else if Uppercase(ExtractFileExt(fTableBName)) = '.ADT' then
ftableB.TableType := ttAdsADT
else { ERROR - unknown table type}
begin
Result := False;
...
exit
end;
ftableB.DatabaseName := ExtractFilePath(fTableBName);
ftableB.TableName := ExtractFileName(fTableBName);
...
/////////////
*****************************
*** THIS IS THE PROBLEM ***
function TpsDBAssert.ConformAtoB: integer;
try
ftableB.FieldDefs.Update;
except
MessageDlg('Unsupported table type. Table:'+ CRLF+
fTableBName, mtError, [mbOK], 0);
Exit;
end;
Jim,
j...@canada.com