asp页面调用excel数据的问题,返回ASP 0178 : 80070005错误

codrwoo 2009-09-13 03:05:03
excel命名为book1.xls,其数据内容(如下)存放在sheet1中

序 号 姓 名 股 票
1 孙春亮 6000
2 宋颜浩 5000
3 费文华 5600

我尝试着用如下脚本访问该表数据,吸取了上次访问access数据库的教训,这次将excel文件权限全部放开了,full control
但浏览该页面的时候依然出错了

Server object error 'ASP 0178 : 80070005'

Server.CreateObject Access Error

/excel.asp, line 4

The call to Server.CreateObject failed while checking permissions. Access is denied to this object.


<%@language=vbscript %>
<%

Set xlApp = server.CreateObject("Excel.Application")

strsource = "d:\mdb\book1.xls"
Set xlstock = xlApp.Workstocks.Open(strsource)
Set xlsheet = xlstock.Sheet1

i=1
response.write "<table cellpadding=0 cellspacing=0 border=1 width=500>"
while xlsheet.cells(i,1)<>""

response.write "<tr>"
response.write " <td height=20 align=center width=100>" & xlsheet.Cells(i, 1) & "</td>"
response.write " <td height=20 align=center width=200>" & xlsheet.Cells(i, 2) & "</td>"
response.write " <td height=20 align=center width=200>" & xlsheet.Cells(i, 3) & "</td>"
response.write "</tr>"
i=i+1

wend
response.write "</table>"
set xlsheet=nothing
set xlstock=nothing
xlApp.quit
%>
...全文
72 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
codrwoo 2009-09-17
  • 打赏
  • 举报
回复
肯定不会啊,我也检查了文件的属性的
qqlxinye 2009-09-14
  • 打赏
  • 举报
回复
Access is denied to this object.访问拒绝,你会不会正打开着xls呀,

28,406

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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