Call this function to throw an exception of type CDaoException from your own code.
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.