delphi中如何删除access中的空记录?
用sql语句
delete * from table1 where len(trim(name))=0
delete * from table1 where name=''
都不行,什么都没有删除

解决方案 »

  1.   

    delete * from table1 where name is nullACCESS里行不行?
      

  2.   

    楼主的方法应该行,出现什么提示
    我试了一下,可以删除!
    1.
    Str := 'delete * from table1 where len(trim(name))=0 ';
    2. 
    Str := ' delete * from table1 where name='''' '; 
      

  3.   

    delete from 表 where len(trim(name))=0
      

  4.   

    你表里的数据是不是从其它地方导过来的,ACCESS经常会有这样的问题,会出现一些非常特殊的字符编码,我曾经也遇到过类似的问题,不知道跟你是不是一样
      

  5.   

    欢迎加入Borland DELPHI程序员,参与群里技术讨论!欢迎女孩子,也欢迎男孩子参与技术讨论!群号15154361
      

  6.   

    樓主看看那些數據是不是真的是空的?如你用:
    select * from table where name is null
    看看能不能找到你的記錄?或者你看看你要刪除的記錄的name字段到底是個什麼樣的情況?或許是類似Alt + 255之類的字符呢:)
      

  7.   

    duanhai你对啦,是delete from table where name is null
    用'delete * from table1 where len(trim(name))<3可以删除小于2位的记录.