var
  tstrl:Tstringlist;
  tablename:string;
 begin
  tstrl:=Tadoquery1.gettablename(tstrl);
  if tstrl.indexof(tablename)<0 then
   showmessage('NOt the Table'); 
 end;

解决方案 »

  1.   

    if exists (select 1
                from  sysobjects
               where  id = object_id('tCustomResultCount')
                and   type = 'U')
       drop table tCustomResultCount
    go
      

  2.   

    procedure TForm1.Button1Click(Sender: TObject);
     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;
      

  3.   

    if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[TableName]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
    drop table [dbo].[TableName]
      

  4.   

    if object_id('TableName') is not null
      drop table tableName
      

  5.   

    我操作的是access数据库,
    adoquery1.SQL.Add('select 号码 into temp from perinfor_input');
    同时在当前库中建立了temp表,同时已经将查询内容添加到了表中。