我用sql删除语句怎么删除不了数据,并且报告Field stuname not found,我为ADOquery加了afterscroll事件:
    edit1.Text:=ADO_info.FieldByName('stunum').AsString;
    edit2.Text:=ADO_info.FieldByName('stuname').AsString;
    edit3.Text:=ADO_info.FieldByName('stuclass').AsString;
    edit4.Text:=ADO_info.FieldByName('stusex').AsString;
其中ado_info是一个ADOQuery,
我的删除语句如下:
  s:='delete  from stu_info where stunum='''+edit1.text+'''';//根据edit中的数据进行删除
 if messagebox(0,'确定要删除数据吗?','删除',MB_OKCANCEL)=1 then
  with ADO_info do
    begin
      close;
      sql.clear;
      sql.Add('select stunum from stu_info where stunum='+''''+edit1.Text+'''');
      open;
      if recordcount<>0 then
       begin
           close;
           //ADO_info.Delete;
           SQL.Clear;
           SQL.Add(s);
          // open;
           execsql;
          close;
           sql.clear;
          SQL.Add('select stunum,stuname,stuclass,stusex from stu_info');
          Open;
        end
      else
        messageDlg('对不起,该记录不存在!',mtinformation,[mbok],0);
  end;
大侠们帮帮忙呀,我分不多呀