AV in TOracleSession.ReturnCode

Sonique

Member²
Hi Marco etc.

I've just found a minor problem with the ReturnCode function. We have some code which looks (roughly)like this:

try
Session.LogOn;
except
Trace.Log('[Error Connecting]: ' +
OracleSession.ErrorMessage(OracleSession.ReturnCode));
raise;
end;

Now if the OCI dll fails to load for whatever reason, TOracleSession.ReturnCode attempts return LDA.rc, raising an AV as the LDA is invalid.

Regards,

Paul
 
An other posibility may be:

Code:
TRY
  Session.LogOn;
EXCEPT
  ON E:EXCEPTION DO BEGIN
    Trace.Log ('[Error Connecting]: ' +
               E.Message);
    RAISE;
    END;
END;

That won't raise an AV.

Oliver
 
This second exception handler is indeed better, but the TOracleSession.ErrorMessage function should not raise an AV of course. We will fix this.

------------------
Marco Kalter
Allround Automations
 
Back
Top