datactrl said:
Hi, all
I've got an error such as "catastrophic failure" with the following
staements:
myRs=idXml.recordset;
myRs.Find("invdate >#01/01/01#");
The error line is pointed to Find statement.
Jack
It appears your answer is at <url:
http://msdn.microsoft.com/library/en-us/ado270/htm/mdmthfindmethodado.asp
/>
"Note An error will occur if a current row position is not set before
calling Find. Any method that sets row position, such as MoveFirst,
should be called before calling Find."
However, calling MoveFirst() on an empty RecordSet can also cause an
error. According to <url:
http://msdn.microsoft.com/library/en-us/ado270/htm/mdmthmovefirst.asp
/> "A call to either MoveFirst or MoveLast when the Recordset is empty
(both BOF and EOF are True) generates an error."
So, the correct code for you should be:
myRs = idXml.recordset;
if (!(myRs.BOF && myRs.EOF)) {
myRs.MoveFirst();
myRs.Find("invdate >#01/01/01#");
}