zgfp.net
当前位置:首页 >> 如何用ASP读取ExCEl文件 >>

如何用ASP读取ExCEl文件

下面是读取一个EXCEL文件并将其写入数据库的代码实例,亲测通过: 注意:EXCEL里面的列名称要和数据库里的字段相同

直接读取 注意点:同读取Acc数据一样 dim ExTName ExTName = "表名" Set conn =Server.CreateObject("ADODB.Connection") StrConn="Driver={Microsoft Excel Driver (*.xls)};DBQ="& Server.MapPath(文件路径和文件名) conn.Open StrConn Set rs ...

Dim Conn,Driver,DBPath,Rs '建立Excel的Connection对象 Set Conn = Server.CreateObject("ADODB.Connection") Driver = "Driver={Microsoft Excel Driver (*.xls)};" DBPath = "DBQ=" & Server.MapPath( "test.xls" ) '调用Open方法打开数据库 ...

Dim Conn,Driver,DBPath,Rs '建立Excel的Connection对象 Set Conn = Server.CreateObject("ADODB.Connection") Driver = "Driver={Microsoft Excel Driver (*.xls)};" DBPath = "DBQ=" & Server.MapPath( "test.xls" ) '调用Open方法打开数据库 ...

Set conn =Server.CreateObject("ADODB.Connection") StrConn="Driver={Microsoft Excel Driver (*.xls)};DBQ="& Server.MapPath("Excel.xls") conn.Open StrConn Set rs = Server.CreateObject("ADODB.Recordset") Sql="select * from [sheet1]"

Dim Conn,Driver,DBPath,Rs '建立Excel的Connection对象 Set Conn = Server.CreateObject("ADODB.Connection") Driver = "Driver={Microsoft Excel Driver (*.xls)};" DBPath = "DBQ=" & Server.MapPath( "test.xls" ) '调用Open方法打开数据库 ...

Dim Conn,Driver,DBPath,Rs '建立Excel的Connection对象 Set Conn = Server.CreateObject("ADODB.Connection") Driver = "Driver={Microsoft Excel Driver (*.xls)};" DBPath = "DBQ=" & Server.MapPath( "test.xls" ) '调用Open方法打开数据库 ...

Dim Conn,Driver,DBPath,Rs '建立Excel的Connection对象 Set Conn = Server.CreateObject("ADODB.Connection") Driver = "Driver={Microsoft Excel Driver (*.xls)};" DBPath = "DBQ=" & Server.MapPath( "test.xls" ) '调用Open方法打开数据库 ...

两种方法1.拿execl当做数据库来读取2.可以把excel另存为网页文件,就可以当做文本文件处理了,里面代码可以找到处理规律。附上处理excel文档的asp代码(就是第一条的方法)setconn2=CreateObject("ADODB.Connection")conn2.Open"Provider=Micros...

当mdb一样使用即可。只不过数据库是XLS。把 access 换成 Excel ,表第一行 为 字段名

网站首页 | 网站地图
All rights reserved Powered by www.zgfp.net
copyright ©right 2010-2021。
内容来自网络,如有侵犯请联系客服。zhit325@qq.com