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;
转载于:https://blog.51cto.com/smiledesky1/1870679