asp 读取excel 的程序问题,高手请指点

lsx_winner917 2005-04-14 04:13:29
Dim Driver, DBPath
Driver="Driver={Microsoft Excel Driver (*.xls)};"
DBPath="DBQ="&"e:\test.xls"
Set connxls2=Getconnection(Driver&"ReadOnly=0;"&DBPath)
set rstschema2=connxls2.openschema(20)
if not rstSchema2.EOF then
xlssheetname=rstSchema2(2)
xlssheetname=right(xlssheetname,len(xlssheetname)-1)
xlssheetname=left(xlssheetname,len(xlssheetname)-2)
end if
set connxls2=nothing
if xlssheetname=empty then
response.write("这个excel文件没有任何表。")
response.end
end if
Function Getconnection( Param )
Dim connxls2

Set Getconnection=Nothing
Set connxls2=Server.CreateObject("ADODB.connection")
If Err.Number <> 0 Then Exit Function
Response.Write Param
'Response.End
connxls2.Open Param
If Err.Number <> 0 Then Exit Function
Set Getconnection=connxls2
End Function

结果报错了,错误报告如下:

错误类型:
Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
[Microsoft][ODBC Excel Driver]常见错误 不能打开注册表关键字 'Temporary (volatile) Jet DSN for process 0xc9c Thread 0xe30 DBC 0x1156374 Excel'。
/unicomweb/test_xsl.asp, 第 28 行
...全文
71 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

28,406

社区成员

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

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