I'd suggest trapping EDatabaseError, rather than the generic Exception.

-----Original Message-----
From: Smith David G (Finance) [mailto:[EMAIL PROTECTED] 
Sent: Thursday, March 17, 2005 6:00 PM
To: [email protected]
Subject: RE: [delphi-en] How do I trap a database exception message


try
  mydatabase.open
except on E: Exception do
  begin
  // E.Message is the exception message
  // Here you would put whatever exception handling you wanted.
  end;
end;


-----Original Message-----
From: jeffgallant2002 [mailto:[EMAIL PROTECTED]
Sent: March 17, 2005 10:34 AM
To: [email protected]
Subject: [delphi-en] How do I trap a database exception message




Delphi 6 - Oracle 9i Lite database

I have a TDatabase object that seems to throw an exception when 
being opened in rare circumstances and never on the development 
system where the debugger would display the message. I'd like to 
trap the exception message in my code so I can work out why it is 
failing.

My code is of the form 

try
  mydatabase.open
except
  do something
  <this is where I'd like to trap the exception message>
  end

I'm sure it is trivially easy but I can't find it in the manuals.

Hope someone can help.

Jeff





-----------------------------------------------------
Home page: http://groups.yahoo.com/group/delphi-en/
To unsubscribe: [EMAIL PROTECTED] 
Yahoo! Groups Links









-----------------------------------------------------
Home page: http://groups.yahoo.com/group/delphi-en/
To unsubscribe: [EMAIL PROTECTED] 



Yahoo! Groups Sponsor   

ADVERTISEMENT
 
<http://us.ard.yahoo.com/SIG=129tvskr0/M=298184.6191685.7192823.3001176/
D=groups/S=1705115362:HM/EXP=1111161652/A=2593423/R=0/SIG=11el9gslf/*htt
p://www.netflix.com/Default?mqso=60190075> click here   
 
<http://us.adserver.yahoo.com/l?M=298184.6191685.7192823.3001176/D=group
s/S=:HM/A=2593423/rand=973942623>       


  _____  

Yahoo! Groups Links


*       To visit your group on the web, go to:
http://groups.yahoo.com/group/delphi-en/
  

*       To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<mailto:[EMAIL PROTECTED]> 
  

*       Your use of Yahoo! Groups is subject to the Yahoo! Terms of
Service <http://docs.yahoo.com/info/terms/> . 


This mail arrived via mail.pineapp.net

************************************************************************
************
This footnote confirms that this email message has been scanned by
PineApp Mail-SeCure for the presence of malicious code, vandals &
computer viruses.
************************************************************************
************




[Non-text portions of this message have been removed]



-----------------------------------------------------
Home page: http://groups.yahoo.com/group/delphi-en/
To unsubscribe: [EMAIL PROTECTED] 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/delphi-en/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to