程序:
dim xmlDoc as DomDocument
set xmlDoc = new DomDocument
xmlDoc.load "C:\config.xml"
问题:
程序运行后,
跟踪 xmlDoc.documentElement 的值总是为
xmlDoc.documentElement is Nothing
是什么原因?
dim xmlDoc as DomDocument
set xmlDoc = new DomDocument
xmlDoc.load "C:\config.xml"
问题:
程序运行后,
跟踪 xmlDoc.documentElement 的值总是为
xmlDoc.documentElement is Nothing
是什么原因?
解决方案 »
- 取oracle数据库中的整型数据为什么会报错?
- image中的图象移动,放大,和缩小.急!在线等!解决之后结贴
- picturebox和image控件设置问题 马上结贴!******************
- 菜鸟向大虾求助!!!望帮助!!!!!谢!!!
- 如何在一个.bas文件中调用另外一个.bas文件
- 关于坐标漂移的问题
- 求教关于api消息前缀缩写的问题???
- 小草,这个贴子只有你能回答:http://www.csdn.net/Expert/topic/441/441284.shtm
- 如何用ado访问不是本的数据库阿?
- 请问:vb里如何使用InternetGetConnectedState这个函数?
- 为什么网页引用控件,结果控件中的wmi部件中的SWbemLocator 访问遭到拒绝
- 急急急急!在VB6.0中怎样用MSXML的方法来判断一个XML文件是否符合XML Schema的格式?
<?xml version="1.0" encoding="ISO-8859-1"?>
<config>
<name>pathname</name>
<value>conf/tomcat-users.xml</value>
</config>现在运行后,还是
xmlDoc.documentElement is Nothing
Dim xDoc As MSXML2.DOMDocument
Set xDoc = New MSXML2.DOMDocument
xDoc.validateOnParse = False '这行用TRUE也试试
If xDoc.Load(sFile) Then
' The document loaded successfully.
' Now do something intersting.
Else
Dim strErrText As String
Dim xPE As MSXML2.IXMLDOMParseError
' ?得parseError?象
Set xPE = xDoc.parseError
With xPE
strErrText = " XML Document 不能LOAD " & _
"原因是." & vbCrLf & _
"error: " & .errorCode & ": " & xPE.reason & vbCrLf & _
"Line #: " & .Line & vbCrLf & _
"Line Position: " & .linepos & vbCrLf & _
"Position In File: " & .filepos & vbCrLf & _
"Source Text: " & .srcText & vbCrLf & _
"Document URL: " & .url
End With
MsgBox strErrText, vbExclamation
Set xPE = Nothing
End If
End Sub
http://www.cnblogs.com/happy-wangtao/archive/2006/12/24/602030.aspx