Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Modules / DAO / VBA / January 2007

Tip: Looking for answers? Try searching our database.

Access VBA count nodes in XML

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Dan - 29 Jan 2007 21:01 GMT
Hello,

is there any count function for an XML object in VBA? i could count the
nodes by a loop but then i don't know how to return to the begining.. any
thoughts?

      Set domDoc = XMLobj.GetNext(10000)
       Dim row As Object
       Dim countmyXMLRecords As Integer
       Set row = domDoc.selectNodes("//row")
       For r = 0 To row.Length - 1
           countmyXMLRecords = countmyXMLRecords + 1
       Next

but then if i want to use it further, the cursor is at row 10,000...

thanks,

dan.
Rick Brandt - 29 Jan 2007 21:04 GMT
> Hello,
>
[quoted text clipped - 11 lines]
>
> but then if i want to use it further, the cursor is at row 10,000...

Isn't that what row.Length is giving you?

Signature

Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt   at   Hunter   dot   com

Dan - 29 Jan 2007 21:25 GMT
Rick,

thanks for your reply. I agree with rows.length but i still have to do
XMLobj.GetNext(10000). I don't know in the first place if i have 10,000 or
more notes... that's my confusion... any way to count all nodes without
for/next?

thanks,
Dan.

> > Hello,
> >
[quoted text clipped - 13 lines]
>
> Isn't that what row.Length is giving you?
Rick Brandt - 29 Jan 2007 22:13 GMT
> Rick,
>
> thanks for your reply. I agree with rows.length but i still have to do
> XMLobj.GetNext(10000). I don't know in the first place if i have
> 10,000 or more notes... that's my confusion... any way to count all
> nodes without for/next?

I am not familiar with that XML method, but I would assume that if you are
only retrieving the XML 10,000 nodes at a time then you won't have any way
to tell how many there are in total until you have retrieved them all.

Signature

Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt   at   Hunter   dot   com

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.