当建立新表new_table到my_db时,我想先查找一下有没有new_table这个表.不知道这样一来的语句怎么写??或delphi有这样的功能吗??delphi连接access

解决方案 »

  1.   

    现用select * from new_table啊,用判断异常的方法不就得了!
    在sql server里有直接语句的,可惜你是用access的
      

  2.   

    加一个TSession组件,用该组件的GetTableNames属性可获得所有的表名。然后在所有的表
    中查找你要的表名。
      

  3.   

    当建立新表new_table到my_db时,我想先查找一下有没有new_table这个表.不知道这样一来的语句怎么写??或delphi有这样的功能吗??delphi连接access
    用一个ADOConnection1连接my_db,ADOQuery1与ADOConnection1连接。设一个变量ExistTables:Tstringlist。
    ADOConnection1中有一个方法就是 ADOConnection1.GetTableNames(ExistTables,false);
    那么ExistTables中就存放了所以库中的表名称。