Export (0) Print
Expand All
Expand Minimize
This topic has not yet been rated - Rate this topic


Call this function to throw an exception of type CDaoException from your own code.

void AFXAPI AfxThrowDaoException( 
   int nAfxDaoError = NO_AFX_DAO_ERROR, 
   SCODE scode = S_OK  

An integer value representing a DAO extended error code, which can be one of the values listed under CDaoException::m_nAfxDaoError.


An OLE error code from DAO, of type SCODE. For information, see CDaoException::m_scode.

The framework also calls AfxThrowDaoException. In your call, you can pass one of the parameters or both. For example, if you want to raise one of the errors defined in CDaoException::nAfxDaoError but you do not care about the scode parameter, pass a valid code in the nAfxDaoError parameter and accept the default value for scode.

For information about exceptions related to the MFC DAO classes, see class CDaoException in this book and the article Exceptions: Database Exceptions.

Header: afxdao.h

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

© 2014 Microsoft. All rights reserved.