<%
'建立Connection对象
Dim E_Conn,E_ConnStr,E_Rs,E_Sql
Set E_Conn = Server.CreateObject("ADODB.Connection")
E_ConnStr = "Driver={Microsoft Excel Driver (*.xls)};DBQ="&Server.MapPath("Excel文件名.xls")
'E_ConnStr = "Provider = Microsoft.Jet.OLEDB.4.0; Data Source ="&Server.MapPath("Excel文件名.xls")&";Extended Properties=Excel 8.0"
E_Conn.Open E_ConnStr
'打开记录集,表名一定要以"[表名$]"的格式
E_Sql="Select * From [Sheet1$]"
Set E_Rs=E_Conn.Execute(E_Sql)
'循环读取所有行
Do While Not E_Rs.EOF
……
Loop
'关闭对象
E_Rs.Close
Set E_Rs=nothing
E_Conn.Close
Set E_Conn=Nothing
%>