Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9111093
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T03:25:29+00:00 2026-06-17T03:25:29+00:00

I am trying to pull address information from an XML document using XPath and

  • 0

I am trying to pull address information from an XML document using XPath and populating fields in an access database with these values. I am able to get everything I need until I have to use predicates (I think this is the way to do it). Here is a sample of the XML:

<GeocodeResponse>
<status>OK</status>
<result>
<type>street_address</type>
<formatted_address>
Street Number Street Address, Kansas City, MO 64120, USA
</formatted_address>
<address_component>
<long_name>Street Number</long_name>
<short_name>Street Number</short_name>
<type>street_number</type>
</address_component>
<address_component>
<long_name>Street Address</long_name>
<short_name>Street Address</short_name>
<type>route</type>
</address_component>
<address_component>
<long_name>Kansas City</long_name>
<short_name>KCMO</short_name>
<type>locality</type>
<type>political</type>
</address_component>

I would like to pull the text for street number, name, and city. Here is what I have in my VBA code:

rst.Edit
rst("Str_Num").Value =.SelectSingleNode("GeocodeResponse/result/address_component/long_name[1]").Text
rst.Update
rst.Edit
rst("Str_Name").Value =SelectSingleNode("GeocodeResponse/result/address_component/long_name[2]").Text
rst.Update
rst.Edit
rst("City").Value =SelectSingleNode("GeocodeResponse/result/address_component/long_name[3]").Text
rst.Update
rst.Edit
rst("Zip").Value =SelectSingleNode("GeocodeResponse/result/address_component/long_name[8]").Text
rst.Update

When ran I get error 91 Object variable or With block variable not set.

The code just above this works as I expected it to but I’m having an issue understanding the predicates. The above code:

rst.Edit
rst("frm_addr").Value = .SelectSingleNode("//formatted_address").Text
rst.Update
rst.Edit
rst("lat").Value = .SelectSingleNode("//location/lat").Text
rst.Update
rst.Edit
rst("lng").Value = .SelectSingleNode("//location/lng").Text
rst.Update

So what do I have wrong?

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T03:25:30+00:00Added an answer on June 17, 2026 at 3:25 am

    There are several address_components tags per result, not several long_names per address_component. Modify your XPath expressions to

    GeocodeResponse/result/address_component[1]/long_name
    

    and so on.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to pull an LDAP jpegPhoto attribute from an openLDAP server using
I am trying to pull in information from Asana API via JQuery.ajax() method. But
I'm trying to pull an email address from the appSettings section of the app.config
I'm trying to pull in images from Flickr using the phpFlickr library but the
Trying pull the database from Hekoku to local but failed. heroku db:pull postgres://root:@localhost/db_name Admittedly,
im trying to pull .swf files from MySQL by using PHP, ive set everything
Hello I am trying to pull information from a page on Wikia for The
Just trying to pull off some SMART info from connected Hard Drives on any
I'm trying to pull data from the YouTube API into a local MySQL table.
I'm trying to pull some data out of logs on remote machines using awk,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.