with ADOQuery1 do
begin
close;
SQL.Clear;
SQL.Add('delete from data111 where ID =:IDEdit');
Parameters.ParamByName('IDEdit').Value:=Trim(IDEdit.Text);
ExecSQL;
end;
不知道问题在哪儿,选中的记录不能删除,大家帮忙看看哈!
begin
close;
SQL.Clear;
SQL.Add('delete from data111 where ID =:IDEdit');
Parameters.ParamByName('IDEdit').Value:=Trim(IDEdit.Text);
ExecSQL;
end;
不知道问题在哪儿,选中的记录不能删除,大家帮忙看看哈!
begin
close;
SQL.Clear;
SQL.Add('delete from data111 where ID ='''+IDEdit+''''');
ExecSQL;
end;
这样写看看
text的值为'',不晓得怎么取不到哦
风云暴
这个方法不行!谢谢你们的解答
begin
close;
SQL.Clear;
SQL.Add('delete from data111 where ID =:IDEdit');
Parameters.ParamByName('IDEdit').Value:=Trim(IDEdit.Text);
ExecSQL;
end;
-------------------------------------------------------------------
楼主:你的ID如果是VARCHAR则改为:
with ADOQuery1 do
begin
close;
SQL.Clear;
SQL.Add('delete from data111 where ID ='''+Trim(IDEdit.Text)+'''');
ExecSQL;
end;
如果是INTEGER改为:
with ADOQuery1 do
begin
close;
SQL.Clear;
SQL.Add('delete from data111 where ID ='+Trim(IDEdit.Text));
ExecSQL;
end;执行完后,如果你的ADOQuery1设置的是批处理的话,则要数据连接组件COMMIT才行.
begin
close;
SQL.Clear;
SQL.Add('delete from data111 where ID =:IDEdit');
Parameters.ParamByName('IDEdit').Value:=Trim(IDEdit.Text);
//更新
ExecSQL;
end;
缺少更新语句。