locatemcurve.Close;
 locatemcurve.CommandText:='delete curve where id = '+locate_id;
//如果你的id是数值型的就不用加引号(改成这样)
//如果是字符串的那就用你的。
 locatemcurve.Execute;

解决方案 »

  1.   

    locatemcurve.CommandText:='delete curve where id ='+''''+Trim(locate_id)+'''';
    再试试?你在执行之前,先用Showmessage(locatemcurve.CommandText)显示看看是否是你需要的SQL
      

  2.   

    locatemcurve.Close;
     locatemcurve.CommandText:='delete from curve where id ='+''''+locate_id+'''';
     locatemcurve.open;
     locatemcurve.Execute;
      

  3.   

    我的locate_id是一个18个字节的字符串。而且是从数据库里读出来的
    Trim(locate_id)
    看来各位都认为我的那段代码没有问题。按如果能够收到的话就应该能够删除是吗
    如果是那样我就认真查查我的程序,我是不知道,我上面执行的代码能不能真正删除数据库里的数据。:)
      

  4.   

    你用的是什么数据库啊?
    有的数据库执行delete只是做了删除标记,而没有实际删除,
      

  5.   

    问题解决了,我在sql事件探查器里发现
    执行了delete curve where id =''
    原来问题还是出在locate_id上面了
    不过多谢各位的关注给分
      

  6.   

    不是给你说了吗?如果发现这种不正常的情况,一定要在执行SQL前先把SQL显示出来看看是否正常阿。