我用ADOquery连接FoxPro表,想将里面的数据全删除
这样写:
try
if tbBookQuery.Active=True then
tbBookQuery.Close;
tbBookQuery.SQL.Text:='delete from tbbook';
tbBookQuery.ExecSQL;
{tbBookQuery.SQL.Text:='select * from tbbook';
tbBookQuery.open;
while not tbBookQuery.Eof do
begin
tbBookQuery.Delete;
tbBookQuery.Next;
end;}
except
showmessage('不能上传数据!');
Exit;
end;
showmessage('have been deleted');
{}里面是另外一种写法,结果都是在FoxPro表里还有数据,但再次用ADOquery查询时有查不到数据,不知道怎么办?
这样写:
try
if tbBookQuery.Active=True then
tbBookQuery.Close;
tbBookQuery.SQL.Text:='delete from tbbook';
tbBookQuery.ExecSQL;
{tbBookQuery.SQL.Text:='select * from tbbook';
tbBookQuery.open;
while not tbBookQuery.Eof do
begin
tbBookQuery.Delete;
tbBookQuery.Next;
end;}
except
showmessage('不能上传数据!');
Exit;
end;
showmessage('have been deleted');
{}里面是另外一种写法,结果都是在FoxPro表里还有数据,但再次用ADOquery查询时有查不到数据,不知道怎么办?
全部删除用Zap即可
如果要物理删除该怎样做呢?
to zxkid
请告知Zap的用法,最好针对上面的程序写一端源代码
其实对用户来说是一样的,删除后已经查不到了,这就行了。
delete from table1 where xxx='xxx' 吧
tbBookQuery.SQL.add('delete from tbbook');试试