try...except..end;查询异常
try
edHH.Visible := False;
ListBox.Visible := not edHH.Visible;
listBox.Clear;
I := 0;
while not Eof do
begin
SendToExeLog(‘H11‘);
listBox.Items.Add(IntToStr(ZSBID) + ‘ ‘ + ZNAME);
setlength(myPP, i + 1);
myPP[I].myInx := (ZBASEID);
inc(I);
end;
RgBox.Caption := ‘请选择品牌‘;
ListBox.SetFocus();
except
on E: Exception do
begin
DataMain.sLastError := e.Message;
SendToExeLog(e.Message); //返回错误原因到日志中
end;
end;
本文出自 “天空一直smile” 博客,请务必保留此出处http://smiledesky1.blog.51cto.com/9662820/1870679
原文地址:http://smiledesky1.blog.51cto.com/9662820/1870679