Quote:> > I'm faced with a strange problem when using the CDaoRecordset Open() or
> > FindFirst() function with a SQL-query:
> > Although the SQL-query is simple and absolutly correct, a CDaoException
> > ('Syntax error in number in query expression!')is thrown when calling the
> > function for the first time.
> > After that, if I repeat the execution with exactly the same query,
> > everthing works fine and I get my desired recordset.
> Yes, the jet engine does this sometimes when useing a numerical expression
> in a query. It's a well known and never fixed bug.
The engine also throws an exception if a math error happens _before_ the call
to Open or FindFirst.
To solve this problem, derive a class from CDaoRecordset, overwrite Open and
FindFirst and derive all your recordsets from this class.
The new functions catch the CDaoException and call the original function a second
time.
--
---------------------------------------------------------------
-- Robert Lechner, University of Technology, Graz, Austria --
---------------------------------------------------------------