Check if Object is assigned to xml-node

Posted on 2003-03-12
Medium Priority
Last Modified: 2010-05-01
If the node id in an XML-Node doesn't exist the following code showed that oID is "nothing"

    Set oID = oUserdetails.selectSingleNode("id")
    id = oID.nodeTypedValue

So I tried only to assign value of oID to id when the node exists

    Set oID = oUserdetails.selectSingleNode("id")
    If oID <> Null Then
        id = oID.nodeTypedValue
    End If

But VB says that the object doesn't support this property "<> Null"

Thanks for any help

Question by:Excattala
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
LVL 43

Accepted Solution

TimCottee earned 200 total points
ID: 8118248
Hi Excattala,

You should test that the object IS Nothing:

If Not(oID Is Nothing) Then
  id = oID.NodeTypedValue


Brainbench MVP for Visual Basic

Experts-Exchange Advisory Board Member

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses
Course of the Month10 days, 16 hours left to enroll

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question