0
我希望能够在读取和写入数据的Excel文件经典ASP
C:\Inetpub\wwwroot\excel\excel.xls
我用下面的代码试图读取和写入使用经典ASP存储在我的本地机器上的Excel文件:
<%
' Set Connection Params
Set oConn = Server.CreateObject("ADODB.connection")
oConn.Open "Driver={Microsoft Excel Driver (*.xls)}; DriverId=790;" &_
"DBQ=c:\Inetpub\wwwroot\excel\excel.xls;" &_
"DefaultDir = C:\Inetpub\wwwroot\excel\"
Set RS=Server.CreateObject("ADODB.recordset")
' Write the SQL Query
RS.open "SELECT * FROM my_range", oConn
do until RS.EOF
Response.Write (RS("NAME") & " -- " & RS("EMAIL") & "")
RS.movenext
Loop
'Close the recordset/connection
RS.Close
oConn.Close
Set RS = Nothing
%>
这是我从here
了,但我得到了以下错误:
Microsoft OLE DB Provider for ODBC Drivers error '80004005'
[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
/ASP/excel.asp, line 4
我只是一个ASP初学者,不知道该怎么做。请帮帮忙!