Article ID: 164954
Article Last Modified on 11/21/2006
/* Compile options needed: none
*/
/* The following code generates the error message:
* "Syntax error in number in query expression".
*
* To avoid the error, comment out the line that generates the
* floating-point error (LINE 1), or remove the comment from the line
* containing the call to _fpreset() (LINE 2).
*/
/* CMySet is derived from CDaoRecordset for the Student table from the
* STDREG32.MDB database, which is included with the DAOENROL sample.
*/
CMySet rs;
// Cause a floating-point error to occur.
double x = 12345.6789;
double y = 0.0;
double z = x / y; // LINE 1: comment out to avoid error
// _fpreset(); // LINE 2: remove comment to avoid error
try
{
rs.m_strFilter = "StudentID = 1001";
rs.Open();
}
catch( CDaoException* e )
{
AfxMessageBox( e->m_pErrorInfo->m_strDescription );
e->Delete();
}
rs.Close();
Additional query words: FindFirst Jet
Keywords: kbprb KB164954