<%
Set c2=server.createobject("ADODB.Connection")
D2="Driver={Microsoft Excel driver(*.xls)};"
Path2="DBQ="&Server.MapPath("agp.xls")
c2.open D2&path2 '这里是出错的地方
Set r2=Server.createobject("ADODB.Recordset")
r2.open "select*from[Sheet1$]",c2,2,2
%>
中
<%
for i=0 to r2.fields.Count-1
response.write""&r2(i).name&" | "
next
%>
<%
r2.movefirst
while not r2.eof
row=""
for i=0 to r2.fields.count-1
row=row&""&r2(i)&" | "
next
response.write row
r2.movenext
wend
%>