Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Exception Problem

Status
Not open for further replies.

BorlandGeek

Programmer
Jun 14, 2004
27
CA
I am upgrading my programs from BDE to ADO and in my old programs i had the line

catch(const Exception &EDatabase)
{
MessageBox(0, EDatabase.Message.c_str(), "Error in SQL", MB_OK);
}

now that im working in 6 it says that EDatabase doesnt exist
does anyone have any ideas
 
Have the problem solved?
(previous post)

Heh just kidding...

I think I would offer the same answer:
Code:
try
{
 //Your code goes here
}
catch(...)  // <--- Those dots are the key
{
 //Handling code goes here
}

Unless there is something else that I have misunderstood, this should work.

Good luck

No! Try not. Do, or do not. There is no try. - Yoda
 
hi Borlandgeek,
HM, what makes me wonder is, what is ADO???

Haven't heard from it yet.

Regards,
Michael
 
onrdbandit: I tried that, the thing is I want to be able to display the message the SQL put out when the ADO messes up

finnmike: ADO is Advanced Database Object it is a way of connecting to and interacting with many forms of databases
 
Have you tried EDatabaseError instead of EDatabase?

James P. Cottingham
[sup]
There's no place like 127.0.0.1.
There's no place like 127.0.0.1.
[/sup]
 
Thanks 2ffat, it worked...
I thought i could name the ref anything i wanted
so i was just going

catch(const Exception &ANYTHING)
{
}
didnt know you had to specify, thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top