建议使用query控件,代码如下:
query1.close;
query1.sql.clear;
query1.sql.add('select * from db where namea=''''');
query1.open;
for i:=1 to query1.recordcount do (*我忘了delphi中的总计录属性是什么,反正不是recordcount就是reccount*)
begin
query1.delete;
query1.next;
end;
query1.close;
query1.sql.clear;
query1.sql.add('select * from db where namea=''''');
query1.open;
for i:=1 to query1.recordcount do (*我忘了delphi中的总计录属性是什么,反正不是recordcount就是reccount*)
begin
query1.delete;
query1.next;
end;
解决方案 »
- fastreport中这样的报表应该怎么设计
- 怎么样得到一个文件的属性信息
- 怎么从文本中按条件读出字符串并组成一个数组?
- 手机同步软件pclink中那个从一张图中截取其中一部分的矩形框是如何做出来的
- 怎样给文件夹设密码,输入密码能够打开文件夹???
- 怎样在电脑启动时,检测是否有串口鼠标(Microsoft Serial Ballpoint),如果有则禁用,求各位大侠给个完整的例程吧
- 轻松一下,来看看这道爱因斯坦的测试题,他说世界上有98%的人回答不出这道题,看看你是否属于另外的2%。
- 高难度问题请教:怎么样防止别的软件检测到我的软件在运行?
- 下面的SQl 语句有什么错误?
- EOleSysError错误,
- DELPHI6 为什么会自动出来cpu监视窗口?
- 求救,关于数据库中存储图像的问题,急呀!!!!!
试想一下,如果你删掉了纪录3,那么原来的记录4就变成了记录3了,但是你要了next之后,指针就直接指向了删除后的记录4,也就是原来的记录5,记录4被忽略了,所以不能这样做。table1.last;
while not query1.bof do
begin
if (table1.fieldbyname('namea').asstring='') then
table1.delete;
table1.prior;
end;
在query.sql.add(delete from tablename where con1 = ''
)
execsql就ok
table1.last;
while not table1.bof do
begin
if (table1.fieldbyname('namea').asstring='') then
begin
table1.delete;
end;
table1.prior;
end;
beign
Query1.Close;
Query1.Clear;
Query1.Add('delete * from Tabel where namea is null');
Query1.ExecSQL;
end;就是这个意思。