Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > MS XML ADO "Fiind" method problem

Reply
Thread Tools

MS XML ADO "Fiind" method problem

 
 
datactrl
Guest
Posts: n/a
 
      09-08-2004
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


 
Reply With Quote
 
 
 
 
Grant Wagner
Guest
Posts: n/a
 
      09-08-2004
datactrl wrote:

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

--
Grant Wagner <(E-Mail Removed)>
comp.lang.javascript FAQ - http://jibbering.com/faq

 
Reply With Quote
 
 
 
 
datactrl
Guest
Posts: n/a
 
      09-09-2004
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
http://msdn.microsoft.com/workshop/a...d/objmodel.asp

Jack

"Grant Wagner" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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("invdate >#01/01/01#");
> }
>
> --
> Grant Wagner <(E-Mail Removed)>
> comp.lang.javascript FAQ - http://jibbering.com/faq
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Translating Oracle Package Call from ADO to ADO.Net dmiratsky@yahoo.com ASP .Net 0 02-14-2005 10:39 PM
ADO.NET PROBLEM writing XML file by schema using datasets Andrius C Programming 3 02-01-2005 06:13 PM
Transfer ADO Code to ADO.NET ronaldlee ASP .Net 1 12-17-2004 04:08 PM
Accessing an ADO Recordset or Record from ADO.NET nita ASP .Net 1 11-20-2004 07:06 AM
Ado sort error-Ado Sort -Relate, Compute By, or Sort operations cannot be done on column(s) whose key length is unknown or exceeds 10 KB. Navin ASP General 1 09-09-2003 07:16 AM



Advertisments