I am trying to get the key, value attributes of the xml using the attached VB script code
<configuration>
<appSettings>
<add key="DeviceConnectionPortNumber" value="5002"/>
<add key="VirtualWintalkConnectionPortNumber" value="5100"/>
</appSettings>
</configuration>
Whenever I set Nothing to an object in the VB script code, i am getting the following error. I developed the vbscript using the macro feature of microsoft Word. I am going to use this vbscript code in ASP. How can I solve this issue?
Runtime Error 91: Object Variable or With Block Variable not set.
Sub Manu_Parse()
Set objXMLDoc = CreateObject("Microsoft.XMLDOM")
objXMLDoc.async = False
objXMLDoc.Load ("c:\Web.Config.xml")
Set appSettingsNode = objXMLDoc.documentElement.FirstChild
Set parameterNodes = appSettingsNode.ChildNodes
For Each parameterNode In parameterNodes
keyName = parameterNode.getAttribute("key")
If keyName = "DeviceConnectionPortNumber" Then
keyVal = parameterNode.getAttribute("value")
parameterNode = Nothing
Exit For
End If
parameterNode = Nothing
Next
parameterNodes = Nothing
sappSettingsNode = Nothing
objXMLDoc = Nothing
End Sub