用BDE函数:
function TDatabase.TableExists(TableName:string):boolean;
var
Cursor: HDBICur;
WildCard: PChar;
SPattern: array[0..127] of Char;
Desc: TBLBaseDesc;
begin
WildCard := nil;
if TableName<>'' then
begin
if ExtractFileExt(TableName)='' then
TableName:=ChangeFileExt(TableName, '.*');
WildCard := AnsiToNative(Locale, TableName, SPattern, SizeOf(SPattern) - 1);
end;
try
Check(DbiOpenTableList(Handle, True, True, WildCard, Cursor));
Result:=DbiGetNextRecord(Cursor, dbiNOLOCK, @Desc, nil) = 0;
finally
DbiCloseCursor(Cursor);
end;
end;