MS XML ADO "Fiind" method problem

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • datactrl

    MS XML ADO "Fiind" method problem

    Hi, all

    I've got an error such as "catastroph ic failure" with the following
    staements:

    myRs=idXml.reco rdset;
    myRs.Find("invd ate >#01/01/01#");

    The error line is pointed to Find statement.

    Jack


  • Grant Wagner

    #2
    Re: MS XML ADO "Fiind&quo t; method problem

    datactrl wrote:
    [color=blue]
    > Hi, all
    >
    > I've got an error such as "catastroph ic failure" with the following
    > staements:
    >
    > myRs=idXml.reco rdset;
    > myRs.Find("invd ate >#01/01/01#");
    >
    > The error line is pointed to Find statement.
    >
    > Jack[/color]

    It appears your answer is at <url:
    Find official documentation, practical know-how, and expert guidance for builders working and troubleshooting in Microsoft products.

    />

    "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:
    Find official documentation, practical know-how, and expert guidance for builders working and troubleshooting in Microsoft products.

    /> "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("invd ate >#01/01/01#");
    }

    --
    Grant Wagner <gwagner@agrico reunited.com>
    comp.lang.javas cript FAQ - http://jibbering.com/faq

    Comment

    • datactrl

      #3
      Re: MS XML ADO &quot;Fiind&quo t; method problem

      Hi, Grant

      Thanks a lot. I tried the code as you provide. It has the same error as
      before. I wonder whether the Find method is supported on XML ADO. The Move
      and related Move methods all work except Find. And when I traced your code,
      the MoveFirst is successfully done. Because I can see it on the web page on
      which a html table is bound with that XML object. I check MS documents, it
      doesn't memtion about Find. The page is here
      Find official documentation, practical know-how, and expert guidance for builders working and troubleshooting in Microsoft products.


      Jack

      "Grant Wagner" <gwagner@agrico reunited.com> wrote in message
      news:413F3EBA.4 C69AA09@agricor eunited.com...[color=blue]
      > It appears your answer is at <url:
      > http://msdn.microsoft.com/library/en...dmethodado.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...hmovefirst.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("invd ate >#01/01/01#");
      > }
      >
      > --
      > Grant Wagner <gwagner@agrico reunited.com>
      > comp.lang.javas cript FAQ - http://jibbering.com/faq
      >[/color]


      Comment

      Working...