后来,用了这种笨方法来实现,因自己是新手,很菜
<%
dim xlsfile
xlsfile="18611jbjc.xls"
Set connx = CreateObject("ADODB.Connection")
on error resume next
connx.open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source="&Server.MapPath(xlsfile)&";Extended Properties=""Excel 8.0;HDR=yes;IMEX=3"""
dim xlsfile1
xlsfile1="18611.xls"
Set connx1= CreateObject("ADODB.Connection")
connx1.open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source="&Server.MapPath(xlsfile1)&";Extended Properties=""Excel 8.0;HDR=yes;IMEX=1"""
if err then
err.clear
set connx=nothing
set connx1=nothing
response.write("<font color=#888888 size=3px>连接到 XLS 文件出现错误,请检查数据处理文件</font> <font color=blue size=3px><b></b></font> <font color=#888888 size=3px>的 EXCEL 连接部分是否设置正确</font>")
response.end()
end if
response.write("EXECL文件连接成功"&"<br>")
set rsx=server.createobject("adodb.recordset")
rsx.open "select * from [sheet1$]",connx,2,3
while not rsx.eof
Set rs=server.CreateObject("ADODB.recordset")
rs.open
"select * from [sheet1$]",connx1,1,1
rs.movefirst
'rs.open
"select * from [sheet1$] where rsx("考号")=rs("no")",connx1,1,1
while not rs.eof
if rsx("考号")=rs("no") then
rsx("政治")=rs("tsco")
rsx.update
end if
rs.movenext
wend
rsx.movenext
wend
'response.write("</table>")
rsx.close
set rsx=nothing
connx.close
set connx=Nothing
response.write(" <font color=blue size=3px><b></b></font>EXECL文件数据交换连接成功"&"<br>")
%>