所有行都没了,你还删除什么?
有什么好判断
if messagedlg('确定要删除所选的记录?',mtConfirmation,[mbyes,mbno],0)= mryes then
with DBGrid1.datasource.datasetdo
begin
First;
While not eofdo
begin
if DBGrid1.SelectedRows.CurrentRowSelected then
Delete
else
Next;
end;
showmessage('删除完毕!');
end;