set conn=server.createobject("adodb.connection")
DBPath=server.mappath("aaa.mdb")
conn.Open "driver={Microsoft Access Driver (*.mdb)};dbq=" & DBPath
set rs=server.createobject("adodb.recordset")
sql="select * from "+request("tablename")
rs.open sql,conn,1,3
Set xlApp = server.CreateObject("Excel.Application")
strsource = server.mappath(request("filename"))
Set xlbook = xlApp.Workbooks.Open(strsource)
Set xlsheet = xlbook.Worksheets(1)
i=2
while xlsheet.cells(i,1)<>""
'response.write xlsheet.cells(i,3) '+xlsheet.cells(i,2)+xlsheet.cells(i,3) & xlsheet.cells(i,4) & xlsheet.cells(i,5) & xlsheet.cells(i,6)
'response.end
rs.addnew
' rs("c_name")=xlsheet.cells(i,1)
rs("c_Devic")=xlsheet.cells(i,1)
rs("c_Description")=xlsheet.cells(i,2)
rs("c_DBP")=trim(xlsheet.cells(i,3))
rs("c_SPQ")=xlsheet.cells(i,4)
rs("c_MOQ")=xlsheet.cells(i,5)
rs("c_Pin")=xlsheet.cells(i,6)
rs("c_Act")=xlsheet.cells(i,7)
rs("c_St")=xlsheet.cells(i,8)
rs("c_Pgm")=xlsheet.cells(i,9)
rs("c_LBE")=xlsheet.cells(i,10)
rs.update
i=i+1
wend
set xlsheet=nothing
xlbook.close
set xlbook=nothing
xlApp.quit
rs.close
set rs =nothing
conn.close
set conn=nothing
response.write "上传成功,数据存入成功!"