Port from Delphi4 -> Delphi5

Steven

Member
Hi,

I'm porting a bunch of applications from Delphi4 to Delphi5. 99% of these applications use DOA, and they all work fine, except for 2 of them.
They are both NT services (all the other applications are 'normal' appl).
Both of them check there Oracle connection before trying to continue.

Here is a piece of code that I use for this:

svMailer.DebugWrite('ConnectOracle --> Try Oracle login');
svMailer.DebugWrite('ConnectOracle --> LogonDatabase='+osMailer.LogonDatabase);
svMailer.DebugWrite('ConnectOracle --> LogonUsername='+osMailer.LogonUsername);
svMailer.DebugWrite('ConnectOracle --> LogonPassword='+osMailer.LogonPassword);
osMailer.Connected := True;
Connected := True;
svMailer.DebugWrite('ConnectOracle --> Connected to Oracle');
except
Connected := False;
svMailer.DebugWrite('ConnectOracle --> Login Oracle FAILED');
svMailer.DebugWrite(IntToStr(osMailer.ReturnCode)
+' '+osMailer.ErrorMessage(osMailer.ReturnCode));

The DebugWrite function writes the strings to a log file. Here is the output:

7/9/01 2:26:23 PM : ConnectOracle --> Try Oracle login
7/9/01 2:26:23 PM : ConnectOracle --> LogonDatabase=**************
7/9/01 2:26:23 PM : ConnectOracle --> LogonUsername=****
7/9/01 2:26:23 PM : ConnectOracle --> LogonPassword=****
7/9/01 2:26:23 PM : ConnectOracle --> Login Oracle FAILED
7/9/01 2:26:24 PM : 0 ORA-00000: normal, successful completion

As you can see, the code branches to the exception block with an Ora return code 0 !!!
This exact piece of code worked fine using D4.

Both for D4 and D5 I use DOA 3.3.1.

Any ideas.

Regards,
Steven
 
The exception is probably not an oracle error. Try to log the actual message of the exception:
Code:
except
  on E: Exception do
  begin
    svMailer.DebugWrite('ConnectOracle --> Login Oracle FAILED:');
    svMailer.DebugWrite(E.Message);
    ...
  end;
end;

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