var
i:Smallint;
begin
try
query1.open;
except
On E:EDBEngineError do
begin
for i:=0 to E.ErrorCount-1 do
if E.Errors.NativeError>0 then
ShowMessage('This is Server Error Message: '+E.Errors.Message)
else
ShowMessage('This is BDE Error Message: '+E.Errors.Message)
end;
end;
end;