asp链接excel2016

来源:互联网 发布:郑州关键词优化 编辑:程序博客网 时间:2024/06/05 18:17
set connXls = Server.CreateObject("ADODB.Connection")connXls.ConnectionString="Provider=Microsoft.ACE.OLEDB.12.0;Persist Security Info=False;Data Source="&Server.MapPath("database/Test.xlsx")&";Extended Properties='Excel 12.0 Xml;HDR=No;IMEX=2'"connXls.open'-------------------------------------------------------strSql="select * from [Sheet1$]"set rs = Server.CreateObject("adodb.recordset")rs.open strSql,connXls,1,1if not rs.eof thenwhile not rs.eof   response.Write(rs(0)&"<br />") rs.movenextwendend ifrs.closeset rs=nothingconnXls.closeset connXls=nothing
Microsoft Access Database Engine 2016/2010 Redistributable 可再发行组件一定要安装哦!