ASP和MS-Access数据库 - 如何从XLS文件导入数据 [英] asp and ms-access db - how to import data from xls file
本文介绍了ASP和MS-Access数据库 - 如何从XLS文件导入数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想允许用户上传xls文件9列和行的数量不受限制。
我会跑过来everyline和数据插入到数据库
i want to allow the user to upload xls file with 9 columns and unlimited number of rows. i will run over everyline and insert the data to the db
我如何读取XLS文件?
how do i read the xls file?
推荐答案
使用SQL语句来更新从Excel访问的例子。
Example of using an SQL statement to update Access from Excel.
Set cn = CreateObject("ADODB.Connection")
scn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\docs\dbto.mdb"
cn.Open scn
sSQL = "SELECT * INTO NewTable FROM "
sSQL = sSQL & "[Excel 8.0;HDR=YES;IMEX=2;DATABASE=C:\Docs\From.xls].[Sheet1$]"
cn.Execute sSQL, recs
MsgBox recs
这篇关于ASP和MS-Access数据库 - 如何从XLS文件导入数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文