Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

strUsername value not displaying

Status
Not open for further replies.

onressy

Programmer
Mar 7, 2006
421
CA
this is driving me nuts, why can't i get the strUsername value?
thanks

Code:
Set xmldoc = Server.CreateObject("Microsoft.XMLDOM")
xmldoc.async = False
xmldoc.load (Server.MapPath("onRes2.xml")) 

If (xmldoc.parseError.errorCode <> 0) Then 
   Response.Write "XML " & strType & " error - " & "<br>" & _
  				  "Error Reason: " & xmldoc.parseError.reason & "<br>" & _
  				  "Source: " & xmldoc.parseError.srcText & "<br>" & _
  				  "Error Line: " & xmldoc.parseError.line & "<br>" & _
 			      "Error Position: " & xmldoc.parseError.linepos & "<br>" 
   Response.End 
Else 

strUsername  = xmldoc.SelectSingleNode("/prop/code/user/@username").Value

response.write strUsername
 
what does alert(xmldoc.SelectSingleNode("/prop/code/user/@username").Value) give you?
 
gives me error:
Object required: 'SelectSingleNode(...)'
 
well it looks to me like you're passing a string to xmldoc.SelectSingleNode(), and it wants an object. Try to look through that function and see.
 
got it figured:
Set objNode = objXML.SelectSingleNode("/property/code/user/@username")
If not objNode Is Nothing Then
strDayTemp = objNode.text
Set objNode = Nothing
End If

thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top