Cancel after Logon Attempt -> Access Violation

jerryb

Member
Server: Oracle 8i on NT with TCP/IP.

Client: Delphi 5

Application: Stripped it down to a simple form with only an OracleSession and OracleLogon on the form.

Code: In the FormCreate event I placed:

OracleLogon1.Execute;
if not OracleSession1.Connected then HALT;

Problem: Everything works fine EXCEPT when I try an invalid logon (for example, using a wrong password), and after getting the logon screen back to re-enter, I instead hit the Cancel button. I will then recieve an EAccessViolation.

Any help would be greatly appreciated.

Sincerely,
Jerry Brillowski, Dallas, TX US
jerryb@airmail.net
 
If you call the Halt procedure in the OnCreate event of an auto-created form, you will get an access violation. This problem is caused by the order in which units are initialized and finalized in this situation. To fix it, call Application.Terminate instead of Halt.

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