M
Mike C#
Hi all,
'Nother question. I have a piece of code that is using the MFC CDatabase
object to connect to a database. It executes a SQL statement against SQL
Server using the ExecuteSQL() function. This brought up the question of
capturing the exceptions that are thrown by the CDatabase object. Is there
a way for me to trap it in my code and use my own error-handling mechanism?
I tried putting it in a try...catch block with no success. As always, any
ideas are appreciated!
By the way, the *only* things I'm using MFC for are the CDatabase and
CRecordset objects. Does anyone out there know of any well-tested,
"light-weight" wrappers for ODBC? (I'm stuck with ODBC for this project,
BTW). The only functions I'm using in the CDatabase and CRecordset are
ExecuteSQL() and retrieving a "scalar" value (i.e., I'm reading a single
row, single column table) via the CRecordset. I'd like to get away from MFC
completely, but also don't want to have to write my own ODBC wrappers if I
can avoid it.
Thanks!
'Nother question. I have a piece of code that is using the MFC CDatabase
object to connect to a database. It executes a SQL statement against SQL
Server using the ExecuteSQL() function. This brought up the question of
capturing the exceptions that are thrown by the CDatabase object. Is there
a way for me to trap it in my code and use my own error-handling mechanism?
I tried putting it in a try...catch block with no success. As always, any
ideas are appreciated!
By the way, the *only* things I'm using MFC for are the CDatabase and
CRecordset objects. Does anyone out there know of any well-tested,
"light-weight" wrappers for ODBC? (I'm stuck with ODBC for this project,
BTW). The only functions I'm using in the CDatabase and CRecordset are
ExecuteSQL() and retrieving a "scalar" value (i.e., I'm reading a single
row, single column table) via the CRecordset. I'd like to get away from MFC
completely, but also don't want to have to write my own ODBC wrappers if I
can avoid it.
Thanks!