"Microsoft.XmlDom" is severely deprecated as you don't know what dom class you'll get. If you can control the environment use install version 4.0 sp2 from msdn and use "Msxml2.DomDocument.4.0" of failing that most servers will have version 3, "Msxml2.DomDocument.3.0".
Also you don't need to bother with the filesystemobject, just try to load the file, if it's not there the load will return false.
That aside I'm assuming you want to create the file if necessary but if it is there already add a new Name/Age pair. I think your code should be:
Code:
Dim objDom
Dim objRoot
Dim objChild1
Dim objChild2
Dim bSuccess
Dim sPath
sPath = Server.MapPath("/contact.xml"))
Set objDom = CreateObject("Msxml2.DomDocument.3.0") 'See note above
objDom.async = False
bSuccess = objDom.load(sPath)
If bSuccess = False Then
objDom.loadXML "<contact/>"
End If
Set objRoot = objDom.documentElement
Set objChild1 = objDom.createElement("Name")
objChild1.text = Request.queryString("fname")
objRoot.appendChild objChild1
Set objChild2 = objDom.createElement("Age")
objChild1.text = Request.queryString("age")
objRoot.appendChild objChild2
objDom.save sPath
Joe (MVP - xml)