主题:哪位懂的大哥看一下 这个数据库批量更新的问题
代码如下:
<!--#include file="shijian.js"-->
<!--#include file="conn/conn.asp"-->
<!--#include file ="fun.asp" -->
<link href="css.css" rel="stylesheet" type="text/css" />
<!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" c />
<title>无标题文档</title>
</head>
<body>
<table width="842"
border="1" align="center" cellpadding="2" cellspacing="0"
bordercolor="#ccd6e6" rules="all"
style="BORDER-RIGHT: #ccd6e6 1px solid; BORDER-TOP: #ccd6e6 1px solid; BORDER-LEFT: #ccd6e6 1px solid; WIDTH: 800; COLOR: #000042; BORDER-BOTTOM: #ccd6e6 1px solid; FONT-FAMILY: Arial; BORDER-COLLAPSE: collapse">
<tr>
<td width="65"><div align="center">录入人</div></td>
<td width="65"><div align="center">执行人</div></td>
<td width="180"><div align="center">任务主题</div></td>
<td width="100"><div align="center">开始时间</div></td>
<td width="100"><div align="center">计划完成时间</div></td>
<td width="70"><div align="center">重要性</div></td>
<td width="80"><div align="center">状态</div></td>
<td width="90"><div align="center"></div></td>
</tr>
</table>
<p>
[b]<%
asd=date()
update renwu set daoqi=true where endtime<asd
%>[/b]
<%
idd="61"'这是第1次读数据库
sql="select * from renwu where daoqi=no and wancheng=no and zhixingren='"&session("admin_name")&"'"
set renwu=server.createobject("adodb.recordset")
renwu.open sql,conn,1,1
dim lngpage
lngpage=FunSwitch(request("page"),1)
If lngpage=0 Then lngpage=1 end if
renwu.pagesize=15
if not renwu.eof then
dim total
total=0
renwu.absolutepage=lngpage
end if
k=0
do while not renwu.eof and total<>renwu.pagesize
k=k+1
%>
</p>
<table width="787" border=1 align=center cellPadding=2 cellSpacing=0
borderColor=#ccd6e6 bgcolor="#FFFFFF" rules=all
style="BORDER-RIGHT: #ccd6e6 1px solid; BORDER-TOP: #ccd6e6 1px solid; BORDER-LEFT: #ccd6e6 1px solid; WIDTH: 800; COLOR: #000042; BORDER-BOTTOM: #ccd6e6 1px solid; FONT-FAMILY: Arial; BORDER-COLLAPSE: collapse">
<tr>
<td width="65"><div align="center">
<% =renwu("lururen") %>
</div></td>
<td width="65"><div align="center">
<% =renwu("zhixingren") %>
</div></td>
<td width="180"><div align="center">
<% =renwu("zhuti") %>
</div></td>
<td width="100"><div align="center">
<% =renwu("starttime") %>
</div></td>
<td width="100"><div align="center">
<% =renwu("endtime") %>
</div></td>
<td width="70"><div align="center">
<% =renwu("chengdu") %>
</div></td>
<td width="80"><div align="center">
</div></td>
<td width="90"><div align="center"></div></td>
</tr>
</table>
<p>
<%
total=total+1
renwu.movenext
loop
%>
</p>
<p> </p>
<table width="761" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="837"><%=funpage(renwu.pagecount,lngpage,renwu.recordcount,renwu.pagesize,"&keyword="&keyword&"&anid="&anid&"&smallclass="&smallclass&"&brand="&brand&"&flag="&flag&"&syy="&syy&"&byy="&byy&"&kflgas="&kflgas&"&jia="&jia&"&jib="&jib)%></td>
</tr>
</table>
<p> </p>
</body>
</html>
数据库:access
数据库表名:renwu
字段:id(自动ID),daoqi(判断是否过期true或false,默认是false),endtime(过期日期)
怎么批量判断daoqi日期小于当前日期就批量更新记录。把endtime字段设置为true。
<%
asd=date()
update renwu set daoqi=true where endtime<asd
%>
这一段 是不是有问题 怎么都提示 网页有错误 数据库 也不更新?
哪位大哥帮帮我呗
<!--#include file="shijian.js"-->
<!--#include file="conn/conn.asp"-->
<!--#include file ="fun.asp" -->
<link href="css.css" rel="stylesheet" type="text/css" />
<!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" c />
<title>无标题文档</title>
</head>
<body>
<table width="842"
border="1" align="center" cellpadding="2" cellspacing="0"
bordercolor="#ccd6e6" rules="all"
style="BORDER-RIGHT: #ccd6e6 1px solid; BORDER-TOP: #ccd6e6 1px solid; BORDER-LEFT: #ccd6e6 1px solid; WIDTH: 800; COLOR: #000042; BORDER-BOTTOM: #ccd6e6 1px solid; FONT-FAMILY: Arial; BORDER-COLLAPSE: collapse">
<tr>
<td width="65"><div align="center">录入人</div></td>
<td width="65"><div align="center">执行人</div></td>
<td width="180"><div align="center">任务主题</div></td>
<td width="100"><div align="center">开始时间</div></td>
<td width="100"><div align="center">计划完成时间</div></td>
<td width="70"><div align="center">重要性</div></td>
<td width="80"><div align="center">状态</div></td>
<td width="90"><div align="center"></div></td>
</tr>
</table>
<p>
[b]<%
asd=date()
update renwu set daoqi=true where endtime<asd
%>[/b]
<%
idd="61"'这是第1次读数据库
sql="select * from renwu where daoqi=no and wancheng=no and zhixingren='"&session("admin_name")&"'"
set renwu=server.createobject("adodb.recordset")
renwu.open sql,conn,1,1
dim lngpage
lngpage=FunSwitch(request("page"),1)
If lngpage=0 Then lngpage=1 end if
renwu.pagesize=15
if not renwu.eof then
dim total
total=0
renwu.absolutepage=lngpage
end if
k=0
do while not renwu.eof and total<>renwu.pagesize
k=k+1
%>
</p>
<table width="787" border=1 align=center cellPadding=2 cellSpacing=0
borderColor=#ccd6e6 bgcolor="#FFFFFF" rules=all
style="BORDER-RIGHT: #ccd6e6 1px solid; BORDER-TOP: #ccd6e6 1px solid; BORDER-LEFT: #ccd6e6 1px solid; WIDTH: 800; COLOR: #000042; BORDER-BOTTOM: #ccd6e6 1px solid; FONT-FAMILY: Arial; BORDER-COLLAPSE: collapse">
<tr>
<td width="65"><div align="center">
<% =renwu("lururen") %>
</div></td>
<td width="65"><div align="center">
<% =renwu("zhixingren") %>
</div></td>
<td width="180"><div align="center">
<% =renwu("zhuti") %>
</div></td>
<td width="100"><div align="center">
<% =renwu("starttime") %>
</div></td>
<td width="100"><div align="center">
<% =renwu("endtime") %>
</div></td>
<td width="70"><div align="center">
<% =renwu("chengdu") %>
</div></td>
<td width="80"><div align="center">
</div></td>
<td width="90"><div align="center"></div></td>
</tr>
</table>
<p>
<%
total=total+1
renwu.movenext
loop
%>
</p>
<p> </p>
<table width="761" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="837"><%=funpage(renwu.pagecount,lngpage,renwu.recordcount,renwu.pagesize,"&keyword="&keyword&"&anid="&anid&"&smallclass="&smallclass&"&brand="&brand&"&flag="&flag&"&syy="&syy&"&byy="&byy&"&kflgas="&kflgas&"&jia="&jia&"&jib="&jib)%></td>
</tr>
</table>
<p> </p>
</body>
</html>
数据库:access
数据库表名:renwu
字段:id(自动ID),daoqi(判断是否过期true或false,默认是false),endtime(过期日期)
怎么批量判断daoqi日期小于当前日期就批量更新记录。把endtime字段设置为true。
<%
asd=date()
update renwu set daoqi=true where endtime<asd
%>
这一段 是不是有问题 怎么都提示 网页有错误 数据库 也不更新?
哪位大哥帮帮我呗