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>")
<form name="form1" method="post" action="xls_three.asp">
<table width="80%" border="0" align="center" cellpadding="5" cellspacing="1" bgcolor="#666666">
<%
'建立Connection对象
Dim db,rs,strSql,i,rst,table_count,table_name,j,t_all,t_all_two
Set db = Server.CreateObject("ADODB.Connection")
db.Open "Driver={Microsoft Excel Driver (*.xls)};Dbq=" & Server.MapPath("shuju.xls")
'打开记录集,表名一定要以"[表名$]"的格式
table_name = request("table_name")
if table_name = "" then
response.write "<script>alert('对不起,表名不能为空')</script>"
response.write "<script>history.back()</script>"
end if
strSql="Select * From ["&table_name&"]"
Set rs=db.Execute(strSql)
if rs.eof and rs.bof then
response.write "<script>alert('对不起 " &table_name&" 表中没有任何数据')</script>"
response.write "<script>history.back()</script>"
end if
'循环读取所有行
Response.Write "<tr bgcolor = white align='center'>"
Response.Write "<td>操作</td>"
For i = 0 to rs.fields.count - 1
Response.Write "<td>" & rs(i).name & "</td>"
Next
Response.Write "</tr>"
j = 0
Do While Not rs.EOF
Response.Write "<tr bgcolor = white align='center'>"
Response.Write "<td><input type = 'checkbox' name = 'checkbox'/></td>"
For i = 0 to rs.fields.count - 1
Response.Write "<td>" & rs(i) & "</td>"
Next
Response.Write "</tr>"
rs.MoveNext
j = j + 1
Loop