vbscript错误800a01a8

lovepeacer 2007-05-18 02:28:28
Microsoft VBScript runtime error '800a01a8'

Object required

/umc/geturlandsize.asp, line 33

xml
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<appSettings>
<add key="ConnectionString" value="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Inetpub\wwwroot\UpdateManage\db1.mdb;"/>
<add key="Domain" value="127.0.0.1"/>
<add key="ProductStore" value="C:\Inetpub\wwwroot\UpdateManage\Data\"/>
<add key="PhoneBookStore" value="C:\Inetpub\wwwroot\UpdateManage\phonebook\"/>
</appSettings>
</configuration>

set xmlDoc=server.CreateObject("Microsoft.XMLDOM")
set xmlappSettings=server.CreateObject("Microsoft.XMLDOM")
set xmladd=server.CreateObject("Microsoft.XMLDOM")

xmlDoc.async="false"
xmlDoc.load(server.MapPath ("\UpdateManage\web.config"))

set xmlappSettings = xmldoc.GetElementsByTagName("appSettings").Item(0)
set xmladd = xmlappSettings.GetElementsByTagName("add") 'line 33

for each x in xmladd
'Check for the Atrribute Value
if x.getAttribute("key") ="ConnectionString" then
'Response.write(x.getAttribute("value"))
ConnectionString=x.getAttribute("value")
end if
next

set xmladd = xmlappSettings.GetElementsByTagName("add") 这行出错,但不知为何,请高手指点
...全文
240 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
huzy204 2007-11-09
  • 打赏
  • 举报
回复
这是VB代码。

读XML,我只用JScript写过。是从根读起的,你检查一下,是不是这里错了。
huzy204 2007-11-09
  • 打赏
  • 举报
回复
set xmlappSettings = xmldoc.GetElementsByTagName( "appSettings ").Item(0)

这句是不是就错了,

你的根节点不是configuration 么?为什么第一次取就取appSettings ?

3,055

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC HTML/XML
社区管理员
  • HTML/XML社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧