日期:2014-05-17 浏览次数:20908 次
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%> <!-- #include file="BGMConn.asp" --> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> <title>导其他工资单</title> </head> <body> <% Set excconn=Server.CreateObject("ADODB.Connection") excStrConn= "Driver={Microsoft Excel Driver (*.xls)};DBQ="&request("file") excconn.Open excStrConn '查询excel语句 Set excrs = Server.CreateObject("ADODB.Recordset") excSql="select * from [qtgzsj$]" excrs.Open excSql,excconn,2,2 do while Not excrs.EOF sql="select * from namesfz where name='"&excrs(0)&"'" 'response.write excrs(0) set rs=server.createObject("ADODB.Recordset") rs.open sql,conn,1,1 if Not rs.EOF then '此用户存在 'response.write rs("id") flat=0 'if not rs.eof then 'j=0 sql1="select * from jhgz where name='"&excrs(0)&"'" set rs1=server.CreateObject("adodb.recordset") rs1.open sql1,conn,1,3 do while Not rs1.EOF if year(date())= year(rs1("time")) and month(rs1("time"))=month( year(date())&"-"&request("month_gz")&"-"&day(date())) then flat=1 for t_i=1 to 4 rs1(t_i+21) = excrs(t_i) next rs1.update 'response.write rs1(2) ' response.write "<script>alert('更新成功!');location.href='gzmanage.asp';<'/script>" end if rs1.movenext loop set rs1=nothing if flat <> 1 then sql2="select * from qit" set rs2=server.CreateObject("adodb.recordset") rs2.open sql2,conn,1,3 rs2.ad