H
happyseasky
Unregistered / Unconfirmed
GUEST, unregistred user!
请各位大侠看一下这段代码里,如何判断删除的错误类型
procedure TForm1.Button1Click(Sender: TObject);
var
sqlstr:string;
begin
if application.MessageBox('确实要删除此记录吗?', '系统信息', MB_ICONQUESTION + MB_OKCANCEL) = IDNo then
exit;
try
with Qry_stnd do
sqlstr:='delete from T_stnd where c_StndCode='''+FieldByName('c_StndCode').text+'''';
Database1.Query1.close;
Database1.Query1.sql.clear;
Database1.Query1.add(sqlstr);
Database1.Query1.ExecSql
except
(请问各位大侠如何在这判断错误类型;比如外部索引删除错误等)
application.MessageBox ('删除失败','系统提示信息',MB_ICONWARNING+MB_OK);
Exit;
end;
end;
procedure TForm1.Button1Click(Sender: TObject);
var
sqlstr:string;
begin
if application.MessageBox('确实要删除此记录吗?', '系统信息', MB_ICONQUESTION + MB_OKCANCEL) = IDNo then
exit;
try
with Qry_stnd do
sqlstr:='delete from T_stnd where c_StndCode='''+FieldByName('c_StndCode').text+'''';
Database1.Query1.close;
Database1.Query1.sql.clear;
Database1.Query1.add(sqlstr);
Database1.Query1.ExecSql
except
(请问各位大侠如何在这判断错误类型;比如外部索引删除错误等)
application.MessageBox ('删除失败','系统提示信息',MB_ICONWARNING+MB_OK);
Exit;
end;
end;