var
tstrl:Tstringlist;
tablename:string;
begin
tstrl:=Tadoquery1.gettablename(tstrl);
if tstrl.indexof(tablename)<0 then
showmessage('NOt the Table');
end;
tstrl:Tstringlist;
tablename:string;
begin
tstrl:=Tadoquery1.gettablename(tstrl);
if tstrl.indexof(tablename)<0 then
showmessage('NOt the Table');
end;
from sysobjects
where id = object_id('tCustomResultCount')
and type = 'U')
drop table tCustomResultCount
go
var
TableList:TstringList;
TableName:string;
begin
TableName:='Table1';
try
TableList:=Tstringlist.Create;
LogADOConnection1.GetTableNames(TableList);
if TableList.IndexOf(TableName)>=0 then//如果表存在
with ADOCommand1 do
begin
CommandText:='drop table '+TableName;
execute;
end;
except
Raise Exception.Create('删除操作失败!');
end;
end;
drop table [dbo].[TableName]
drop table tableName
adoquery1.SQL.Add('select 号码 into temp from perinfor_input');
同时在当前库中建立了temp表,同时已经将查询内容添加到了表中。