Look at the code:
Copy Code code as follows:
<% @LANGUAGE = "VBSCRIPT" codepage= "65001"%>
<%
Dim conn,rs,excelfilename
Excelfilename=server.mappath ("Data/test.xls")
Set conn = Server.CreateObject ("ADODB. Connection ")
Conn.connectionstring= "Provider=Microsoft.Jet.OLEDB.4.0; Persist security Info=true;data source= "& Excelfilename &"; Extended properties= "" Excel 8.0; Hdr=yes;imex=1 "";
Conn.Open ()
Set Rs=conn. OpenSchema (20)
%>
<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">
<meta http-equiv= "Content-type" content= "text/html; Charset=utf-8 "/>
<title>excel Operations </title>
<body>
<%
Dim i
Response.Write ("Excel Table information field: <br/>------------------------<br/>")
For i=0 to rs.fields.count-1 step 1
Response.Write (Rs.fields (i) .name& "<br/>")
Next
Response.Write (table name in <BR/>excel (table_name): <br/>------------------------<br/> ")
While not Rs. Eof
Response.Write (RS ("table_name") & "<br/>")
Rs.movenext
Wend
%>
</body>