使用AdoQuery组件,为其设置适当的SQL语句,然后,调用其ExecSQL方法即可! 例如: adoquery1.sql.clear; adoquery1.Sql.Add('delete 表名 where 关键字段=值'); adoquery1.ExecSql;
如果连接了表格,可以直接删除: while not adoquery.eof do begin adoquery.delete;//删除当前数据 end;如果想删除多行: adoquery.close; adoquery.sql.text:='delete from tablename where id=:id'; adoqueery.parametes.paravalue['id']:=值或字符串 adoquery.execsql;
例如:
adoquery1.sql.clear;
adoquery1.Sql.Add('delete 表名 where 关键字段=值');
adoquery1.ExecSql;
while not adoquery.eof do
begin
adoquery.delete;//删除当前数据
end;如果想删除多行:
adoquery.close;
adoquery.sql.text:='delete from tablename where id=:id';
adoqueery.parametes.paravalue['id']:=值或字符串
adoquery.execsql;