Excel数据怎么导入Access数据库

excel

1个回答

写回答

leitian

2026-02-18 09:40

+ 关注

excel
excel

我刚整了个玩意儿,要不要给你瞅瞅...先给你贴段代码,% Server.ScriptTimeOut=9999999 %题库导入

% set rs=server.CreateObject(adodb.recordset) update_sql=select xingming,b,c,d from biao rs.open update_sql,conn,2,3 Set xlApp = server.CreateObject(excel.Application) strsource = server.mappath(1.xls) Set xlbook = xlApp.Workbooks.Open(strsource) Set xlsheet= xlbook.Worksheets(1) i=1 do while (not xlsheet.cells(1,i)=) i=i+1 loop ii=i-1 RecNo=1 j=2Do While (xlsheet.cells(j,1)) rs.addnew i=1 for i=1 to ii rs(i-1)=xlsheet.cells(j,i) next j=j+1 rs.update RecNo=RecNo+1 Loopif err.number=0 then response.Write() end if rs.close set rs=nothing set db=nothing xlBook.Close (True) '关闭工作簿 xlApp.Quit '结束excel对象 Set xlApp = Nothing '释放xlApp对象%

举报有用(0分享收藏

Copyright © 2025 IZhiDa.com All Rights Reserved.

知答 版权所有 粤ICP备2023042255号