qrytemp.SQL.Add('select count(*) from troom where classname='+ QuotedStr(TreeView1.Selected.Text));
qrytemp.Open;
//Edit1.Text:= IntToStr(qrytemp.RecordCount);
if qrytemp.RecordCount>0 then
begin
Application.MessageBox('不能删除','系统提示',MB_OK);
Exit;
end
可有的数据库表中的记录集就是0为什么还是不能删除,出现MessageBox对话框呢?
qrytemp.Open;
//Edit1.Text:= IntToStr(qrytemp.RecordCount);
if qrytemp.RecordCount>0 then
begin
Application.MessageBox('不能删除','系统提示',MB_OK);
Exit;
end
可有的数据库表中的记录集就是0为什么还是不能删除,出现MessageBox对话框呢?
qrytemp.Open;
//Edit1.Text:= IntToStr(qrytemp.RecordCount);
if qrytemp.RecordCount>0 then
begin
Application.MessageBox('不能删除','系统提示',MB_OK);
Exit;
end 呵呵,你用count会返回一行的,0也回返回0
if qrytemp.Fields[0].AsInteger >0 then //这样试试!
begin
Application.MessageBox('不能删除','系统提示',MB_OK);
Exit;
end