标题:[求助]我想做个简单的分页~~~~~~~~~~
取消只看楼主
ASP汽车
Rank: 1
等 级:新手上路
帖 子:197
专家分:0
注 册:2007-7-4
 问题点数:0 回复次数:5 
[求助]我想做个简单的分页~~~~~~~~~~

<%

sql="select APPLY_DEPARTMENT,APPLIER,MAJOR_IDEA,IT_UNDERTAKER,APPLY_TIME,WISH_FINISH_TIME,TOTESTTIME,REQUIRE_ESTI.PHASE from songzw.REQUIRE_BILL inner join REQUIRE_ESTI on songzw.REQUIRE_BILL.IT_NO=REQUIRE_ESTI.IT_NO where 1=1"

rs.open sql,conn,3
rs.pagesize=2
if request("page")<>"" then
epage=cint(request("page"))
if epage<1 then epage=1
if epage>rs.pagecount then epage=rs.pagecount
else
epage=1
end if
rs.absolutepage=epage
%>
<TABLE
...............需要显示的字段名
<%
for i=0 to rs.pagesize-1
if rs.bof or rs.eof then exit for
%>
.....................显示查询的结果
</table>
<p align="center">
<a href="">首页</a>&nbsp;
<a href="dispose_demand.ASP?page=<%=epage-1%>">前一页</a>&nbsp;
<a href="dispose_demand.ASP?page=<%=epage+1%>">后一页</a>&nbsp;
<a href="dispose_demand.ASP?page=<%=rs.pagecount%>">末页</a>
</p>
<p align="center">现在是第<%=epage%>页一共有<%=rs.pagecount%>页</p>
<%
conn.close()
%>

这样为啥不能实现呢,我是参照了
http://www.bc-cn.net/Article/web/asp/jszl/200610/4499.html
这个写的,帮我看看

搜索更多相关主题的帖子: sql request inner where 
2007-07-16 09:35
ASP汽车
Rank: 1
等 级:新手上路
帖 子:197
专家分:0
注 册:2007-7-4
得分:0 

我还是把整段贴出来,能看的就帮我看下吧

<%

sql="select APPLY_DEPARTMENT,APPLIER,MAJOR_IDEA,IT_UNDERTAKER,APPLY_TIME,WISH_FINISH_TIME,TOTESTTIME,REQUIRE_ESTI.PHASE from songzw.REQUIRE_BILL inner join REQUIRE_ESTI on songzw.REQUIRE_BILL.IT_NO=REQUIRE_ESTI.IT_NO where 1=1"

rs.open sql,conn,3
rs.pagesize=2
if request("page")<>"" then
epage=cint(request("page"))
if epage<1 then epage=1
if epage>rs.pagecount then epage=rs.pagecount
else
epage=1
end if
rs.absolutepage=epage
%>

<TABLE cellPadding=1 align="center" cellSpacing=1 align=center border=1 width="900" height="1" >
<%
response.write"<tr>"
response.write"<td width=100> 需求单位 </td>"
response.write"<td width=100> 需求提出人 </td>"
response.write"<td width=100> 主旨 </td>"
response.write"<td width=100> 资讯主办 </td>"
response.write"<td width=100> 需求提出日期</td>"
response.write"<td width=100> 希望上线日期 </td>"
response.write"<td width=100> 预估完成日期 </td>"
response.write"<td width=100> 状态</td>"
response.write"<td width=100> 说明</td></tr>"
%>
<%
for i=0 to rs.pagesize-1
if rs.bof or rs.eof then exit for
%>
<%
Set Rs = server.CreateObject("Adodb.Recordset")
'sql="select APPLY_DEPARTMENT,APPLIER,MAJOR_IDEA,IT_UNDERTAKER,APPLY_TIME,WISH_FINISH_TIME,TOTESTTIME,REQUIRE_ESTI.PHASE from songzw.REQUIRE_BILL inner join REQUIRE_ESTI on songzw.REQUIRE_BILL.IT_NO=REQUIRE_ESTI.IT_NO "

sql="select APPLY_DEPARTMENT,APPLIER,MAJOR_IDEA,IT_UNDERTAKER,APPLY_TIME,WISH_FINISH_TIME,TOTESTTIME,REQUIRE_ESTI.PHASE from songzw.REQUIRE_BILL inner join REQUIRE_ESTI on songzw.REQUIRE_BILL.IT_NO=REQUIRE_ESTI.IT_NO where 1=1"

if len(MAJOR_IDEA)>0 then
sql=sql &" and MAJOR_IDEA like '%"& MAJOR_IDEA &"%'"
end if

if len(APPLY_TIME_start)>1 then
sql=sql &" and APPLY_TIME >='"& APPLY_TIME_start &"'"
end if

if len(APPLY_TIME_end)>1 then
sql=sql&" and APPLY_TIME <='"& APPLY_TIME_end &"'"
end if


if len( WISH_FINISH_TIME_start)>1 then
sql=sql&" and WISH_FINISH_TIME >='"& WISH_FINISH_TIME_start &"'"
end if

if len(WISH_FINISH_TIME_end)>1 then
sql=sql&" and APPLY_TIME <='"& WISH_FINISH_TIME_end &"'"
end if

if len(IT_UNDERTAKER)>1 then
sql=sql&" and IT_UNDERTAKE = '"& IT_UNDERTAKE &"'"
end if

if len(PHASE)>3 then
sql=sql&" and PHASE='"& PHASE &"'"
end if
Rs.open SQL,CONN,1,1

if Not rs.Eof then Rs.MoveFirst

if sql <> "select APPLY_DEPARTMENT,APPLIER,MAJOR_IDEA,IT_UNDERTAKER,APPLY_TIME,WISH_FINISH_TIME,TOTESTTIME,REQUIRE_ESTI.PHASE from songzw.REQUIRE_BILL inner join REQUIRE_ESTI on songzw.REQUIRE_BILL.IT_NO=REQUIRE_ESTI.IT_NO where 1=1" then

Do while Not rs.Eof
nAPPLY_DEPARTMENT=trim(rs.fields("APPLY_DEPARTMENT"))
nAPPLIER=trim(rs.fields("APPLIER"))
nMAJOR_IDEA=trim(rs.fields("MAJOR_IDEA"))
nIT_UNDERTAKER=trim(rs.fields("IT_UNDERTAKER"))
nAPPLY_TIME=trim(rs.fields("APPLY_TIME"))
nWISH_FINISH_TIME=trim(rs.fields("WISH_FINISH_TIME"))
nTOTESTTIME=trim(rs.fields("TOTESTTIME"))
nPHASE=trim(rs.fields("PHASE"))


response.write"<tr>"
response.write"<td width=100>" & nAPPLY_DEPARTMENT & "</td>"
response.write"<td width=100>" & nAPPLIER & "</td>"
response.write"<td width=100>" & nMAJOR_IDEA & "</td>"
response.write"<td width=100>" & nIT_UNDERTAKER & "</td>"
response.write"<td width=100>" & nAPPLY_TIME & "</td>"
response.write"<td width=100>" & nWISH_FINISH_TIME & "</td>"
response.write"<td width=100>" & nTOTESTTIME & "</td>"
response.write"<td width=100>" & nPHASE & "</td></tr>"

Rs.MoveNext
Loop
end if

%>
</table>
<p align="center">
<a href="">首页</a>&nbsp;
<a href="dispose_demand.ASP?page=<%=epage-1%>">前一页</a>&nbsp;
<a href="dispose_demand.ASP?page=<%=epage+1%>">后一页</a>&nbsp;
<a href="dispose_demand.ASP?page=<%=rs.pagecount%>">末页</a>
</p>
<p align="center">现在是第<%=epage%>页一共有<%=rs.pagecount%>页</p>
<%
conn.close()
%>


学习ASP中.....难啊......
2007-07-16 09:40
ASP汽车
Rank: 1
等 级:新手上路
帖 子:197
专家分:0
注 册:2007-7-4
得分:0 
好的我看看,谢谢哈

学习ASP中.....难啊......
2007-07-16 09:51
ASP汽车
Rank: 1
等 级:新手上路
帖 子:197
专家分:0
注 册:2007-7-4
得分:0 

<%
StrConn="DRIVER={SQL Server};SERVER=semhq29;UID=sa;PWD=sema512;DATABASE=DDS_DB"
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open StrConn

Set rs = Server.CreateObject ("ADODB.Recordset")
sql="select APPLY_DEPARTMENT,APPLIER,MAJOR_IDEA,IT_UNDERTAKER,APPLY_TIME,WISH_FINISH_TIME,TOTESTTIME,REQUIRE_ESTI.PHASE from songzw.REQUIRE_BILL inner join REQUIRE_ESTI on songzw.REQUIRE_BILL.IT_NO=REQUIRE_ESTI.IT_NO "
rs.Open sql, conn, 1
page=1
rs.PageSize = 5

if Not IsEmpty(Request("Page")) then

Page = CInt(Request("Page"))

if Page > rs.PageCount then
rs.AbsolutePage = rs.PageCount

elseif Page <= 0 then
Page = 1
else
rs.AbsolutePage = Page
end if
End if
Page = rs.AbsolutePage
%>
<%
For i = 1 to rs.PageSize
if rs.EOF then
Exit For
end if
%>


<TABLE cellPadding=1 align="center" cellSpacing=1 align=center border=1 width="900" height="1" >
<%
response.write"<tr>"
response.write"<td width=100> 需求单位 </td>"
response.write"<td width=100> 需求提出人 </td>"
response.write"<td width=100> 主旨 </td>"
response.write"<td width=100> 资讯主办 </td>"
response.write"<td width=100> 需求提出日期</td>"
response.write"<td width=100> 希望上线日期 </td>"
response.write"<td width=100> 预估完成日期 </td>"
response.write"<td width=100> 状态</td>"
response.write"<td width=100> 说明</td></tr>"


Set Rs = server.CreateObject("Adodb.Recordset")
'sql="select APPLY_DEPARTMENT,APPLIER,MAJOR_IDEA,IT_UNDERTAKER,APPLY_TIME,WISH_FINISH_TIME,TOTESTTIME,REQUIRE_ESTI.PHASE from songzw.REQUIRE_BILL inner join REQUIRE_ESTI on songzw.REQUIRE_BILL.IT_NO=REQUIRE_ESTI.IT_NO "

sql="select APPLY_DEPARTMENT,APPLIER,MAJOR_IDEA,IT_UNDERTAKER,APPLY_TIME,WISH_FINISH_TIME,TOTESTTIME,REQUIRE_ESTI.PHASE from songzw.REQUIRE_BILL inner join REQUIRE_ESTI on songzw.REQUIRE_BILL.IT_NO=REQUIRE_ESTI.IT_NO where 1=1"

if len(MAJOR_IDEA)>0 then
sql=sql &" and MAJOR_IDEA like '%"& MAJOR_IDEA &"%'"
end if

if len(APPLY_TIME_start)>1 then
sql=sql &" and APPLY_TIME >='"& APPLY_TIME_start &"'"
end if

if len(APPLY_TIME_end)>1 then
sql=sql&" and APPLY_TIME <='"& APPLY_TIME_end &"'"
end if


if len( WISH_FINISH_TIME_start)>1 then
sql=sql&" and WISH_FINISH_TIME >='"& WISH_FINISH_TIME_start &"'"
end if

if len(WISH_FINISH_TIME_end)>1 then
sql=sql&" and APPLY_TIME <='"& WISH_FINISH_TIME_end &"'"
end if

if len(IT_UNDERTAKER)>1 then
sql=sql&" and IT_UNDERTAKE = '"& IT_UNDERTAKE &"'"
end if

if len(PHASE)>3 then
sql=sql&" and PHASE='"& PHASE &"'"
end if
Rs.open SQL,CONN,1,1

if Not rs.Eof then Rs.MoveFirst

if sql <> "select APPLY_DEPARTMENT,APPLIER,MAJOR_IDEA,IT_UNDERTAKER,APPLY_TIME,WISH_FINISH_TIME,TOTESTTIME,REQUIRE_ESTI.PHASE from songzw.REQUIRE_BILL inner join REQUIRE_ESTI on songzw.REQUIRE_BILL.IT_NO=REQUIRE_ESTI.IT_NO where 1=1" then

Do while Not rs.Eof
nAPPLY_DEPARTMENT=trim(rs.fields("APPLY_DEPARTMENT"))
nAPPLIER=trim(rs.fields("APPLIER"))
nMAJOR_IDEA=trim(rs.fields("MAJOR_IDEA"))
nIT_UNDERTAKER=trim(rs.fields("IT_UNDERTAKER"))
nAPPLY_TIME=trim(rs.fields("APPLY_TIME"))
nWISH_FINISH_TIME=trim(rs.fields("WISH_FINISH_TIME"))
nTOTESTTIME=trim(rs.fields("TOTESTTIME"))
nPHASE=trim(rs.fields("PHASE"))
response.write"<tr>"
response.write"<td width=100>" & nAPPLY_DEPARTMENT & "</td>"
response.write"<td width=100>" & nAPPLIER & "</td>"
response.write"<td width=100>" & nMAJOR_IDEA & "</td>"
response.write"<td width=100>" & nIT_UNDERTAKER & "</td>"
response.write"<td width=100>" & nAPPLY_TIME & "</td>"
response.write"<td width=100>" & nWISH_FINISH_TIME & "</td>"
response.write"<td width=100>" & nTOTESTTIME & "</td>"
response.write"<td width=100>" & nPHASE & "</td></tr>"
Rs.MoveNext
Loop
end if

%>

</table>

<%if request("page")>1 then%><a Href="dispose_demand.asp?Page=<% = 1%>">首页</a> <a Href="dispose_demand.asp?Page=<% =request("page") -1 %>">上一页</a><%end if %><%if request("page")<>rs.pagecount then %><a Href="dispose_demand.asp?Page=<% =request("page") + 1%>">下一页</a> <a Href="dispose_demand.asp?Page=<% = rs.PageCount%>">尾页</a> <% end if %>
<%
rs.close
Set rs = Nothing
conn.close
set conn=nothing
%>
/td>
</tr>

</form>
</body>
</html>

<script language="vbscript">
dispose_demand.MAJOR_IDEA.value="<%=MAJOR_IDEA%>"
dispose_demand.APPLY_TIME_start.value="<%=APPLY_TIME_start%>"
dispose_demand.APPLY_TIME_end.value="<%=APPLY_TIME_start%>"
dispose_demand.WISH_FINISH_TIME_start.value="<%=WISH_FINISH_TIME_start%>"
dispose_demand.WISH_FINISH_TIME_end.value="<%=WISH_FINISH_TIME_end%>"
dispose_demand. IT_UNDERTAKER.value="<%= IT_UNDERTAKER%>"
dispose_demand.PHASE.value="<%=PHASE%>"
</script>

还是没有研究出来,我改成这样,可是还是不行,会报措说 缺少红色的地方“next”,有空的大哥就帮我看看吧,谢谢了
黑色的字是我运行通过的程序,就是没有分页功能试,运行已经通过了,蓝色是我为了实现分页功能添加的代码,就出错了


学习ASP中.....难啊......
2007-07-16 11:08
ASP汽车
Rank: 1
等 级:新手上路
帖 子:197
专家分:0
注 册:2007-7-4
得分:0 

我先谢谢yndkaiyndkaiyndkaiyndkaiyndkai

我现在想用调用一个通用的分类代码
可是怎么改都不行,有空的人就帮我看看谢谢哦
<TABLE cellPadding=1 align="center" cellSpacing=1 align=center border=1 width="900" height="1" >
<%
response.write"<tr>"
response.write"<td width=100> 需求单位 </td>"
response.write"<td width=100> 需求提出人 </td>"
response.write"<td width=100> 主旨 </td>"
response.write"<td width=100> 资讯主办 </td>"
response.write"<td width=100> 需求提出日期</td>"
response.write"<td width=100> 希望上线日期 </td>"
response.write"<td width=100> 预估完成日期 </td>"
response.write"<td width=100> 状态</td>"
response.write"<td width=100> 说明</td></tr>"

Set Rs = server.CreateObject("Adodb.Recordset")
'sql="select APPLY_DEPARTMENT,APPLIER,MAJOR_IDEA,IT_UNDERTAKER,APPLY_TIME,WISH_FINISH_TIME,TOTESTTIME,REQUIRE_ESTI.PHASE from songzw.REQUIRE_BILL inner join REQUIRE_ESTI on songzw.REQUIRE_BILL.IT_NO=REQUIRE_ESTI.IT_NO "

sql="select APPLY_DEPARTMENT,APPLIER,MAJOR_IDEA,IT_UNDERTAKER,APPLY_TIME,WISH_FINISH_TIME,TOTESTTIME,REQUIRE_ESTI.PHASE from songzw.REQUIRE_BILL inner join REQUIRE_ESTI on songzw.REQUIRE_BILL.IT_NO=REQUIRE_ESTI.IT_NO where 1=1"

if len(MAJOR_IDEA)>0 then
sql=sql &" and MAJOR_IDEA like '%"& MAJOR_IDEA &"%'"
end if

if len(APPLY_TIME_start)>1 then
sql=sql &" and APPLY_TIME >='"& APPLY_TIME_start &"'"
end if

if len(APPLY_TIME_end)>1 then
sql=sql&" and APPLY_TIME <='"& APPLY_TIME_end &"'"
end if


if len( WISH_FINISH_TIME_start)>1 then
sql=sql&" and WISH_FINISH_TIME >='"& WISH_FINISH_TIME_start &"'"
end if

if len(WISH_FINISH_TIME_end)>1 then
sql=sql&" and APPLY_TIME <='"& WISH_FINISH_TIME_end &"'"
end if

if len(IT_UNDERTAKER)>1 then
sql=sql&" and IT_UNDERTAKE = '"& IT_UNDERTAKE &"'"
end if

if len(PHASE)>3 then
sql=sql&" and PHASE='"& PHASE &"'"
end if
Rs.open SQL,CONN,1,1

if Not rs.Eof then Rs.MoveFirst

if sql <> "select APPLY_DEPARTMENT,APPLIER,MAJOR_IDEA,IT_UNDERTAKER,APPLY_TIME,WISH_FINISH_TIME,TOTESTTIME,REQUIRE_ESTI.PHASE from songzw.REQUIRE_BILL inner join REQUIRE_ESTI on songzw.REQUIRE_BILL.IT_NO=REQUIRE_ESTI.IT_NO where 1=1" then

Do while Not rs.Eof
nAPPLY_DEPARTMENT=trim(rs.fields("APPLY_DEPARTMENT"))
nAPPLIER=trim(rs.fields("APPLIER"))
nMAJOR_IDEA=trim(rs.fields("MAJOR_IDEA"))
nIT_UNDERTAKER=trim(rs.fields("IT_UNDERTAKER"))
nAPPLY_TIME=trim(rs.fields("APPLY_TIME"))
nWISH_FINISH_TIME=trim(rs.fields("WISH_FINISH_TIME"))
nTOTESTTIME=trim(rs.fields("TOTESTTIME"))
nPHASE=trim(rs.fields("PHASE"))


response.write"<tr>"
response.write"<td width=100>" & nAPPLY_DEPARTMENT & "</td>"
response.write"<td width=100>" & nAPPLIER & "</td>"
response.write"<td width=100>" & nMAJOR_IDEA & "</td>"
response.write"<td width=100>" & nIT_UNDERTAKER & "</td>"
response.write"<td width=100>" & nAPPLY_TIME & "</td>"
response.write"<td width=100>" & nWISH_FINISH_TIME & "</td>"
response.write"<td width=100>" & nTOTESTTIME & "</td>"
response.write"<td width=100>" & nPHASE & "</td></tr>"
Rs.MoveNext
Loop
end if

%>

</table>

这是我最原始的代码就是没有分页功能,其它都是通过的,下面是我想调用的通用分页代码
http://www.web23.cn/article/20074/11/638.html


学习ASP中.....难啊......
2007-07-16 13:51
ASP汽车
Rank: 1
等 级:新手上路
帖 子:197
专家分:0
注 册:2007-7-4
得分:0 

我把我的程序改了下,现在贴出来有空的就看看
这个分页问题已经骚扰我好久,快晕了,弄了好多个都不行
<%response.Buffer=true%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>需求单系统处理历史查询</title>
</head>
<!--#include file="conn.asp"-->
<script type="text/javascript" src="calendar.js"></script>

<form action="dispose_history.asp" method="post" name="dispose_history">
<table width="852" border="1" align="center">
<td colspan="4" class="titleClass">需求单系统查询画面</td>
<tr>
<td width="115" height="48">需求主旨:</td>
<td colspan="3"><label>
<input type="text" id="MAJOR_IDEA" name="MAJOR_IDEA" size="65" maxlength="65" />
</label></td>
</tr>
<tr>
<td height="43">需求单提出日期:</td>
<td width="305"><label>
<input onFocus="calendar()" name="APPLY_TIME_start" type="text" id="APPLY_TIME_start" />
</label></td>
<td width="87">至: </td>
<td width="317"><label>
<input onFocus="calendar()" name="APPLY_TIME_end" type="text" id="Calendar1" />
</label></td>
</tr>
<tr>
<td height="35">希望上线时间:</td>
<td><label>
<input onFocus="calendar()" name="WISH_FINISH_TIME_start" type="text" id="Calendar1" />
</label></td>
<td>至:</td>
<td><label>
<input onFocus="calendar()" name="WISH_FINISH_TIME_end" type="text" id="Calendar1" />
</label></td>
</tr>
<tr>
<td height="42">资讯主办:</td>
<td><label>
<input name="IT_UNDERTAKER" type="text" size="30" />
</label></td>
<td>需求状态:</td>
<td><label>
<select name="PHASE" >
<option selected="selected">请选择</option>
<option value="提单审核">提单审核</option>
<option value="效益评估">效益评估</option>
<option value="需求确认">需求确认</option>
<option value="系统分析">系统分析</option>
<option value="系统开发">系统开发</option>
<option value="系统测试">系统测试</option>
<option value="用户测试">用户测试</option>
<option value="达成目标">达成目标</option>
<option value="正式上线">正式上线</option>
</select>
</label></td>
</tr>
<tr>
<td height="41" colspan="4">查询条件选择
<label>
<input type="button" name="select1" value="查询" />
<input name="reset" type="button" onClick="show(); return false;" value="重置" />
</label></td>
</tr>
</table>
</tr>
</table>
<p>&nbsp;</p>
<tr><td colspan=4 width="600" height="10"><input name=flag type=hidden value=""> </td></tr>


<TABLE cellPadding=1 align="center" cellSpacing=1 align=center border=1 width="900" height="1" >
<%
response.write"<tr>"
response.write"<td width=100> 需求单位 </td>"
response.write"<td width=100> 主旨 </td>"
response.write"<td width=100> 资讯主办</td>"
response.write"<td width=100> 预估完成日期 </td>"
response.write"<td width=100> 需求确认日期</td>"
response.write"<td width=100> 分析完成日期 </td>"
response.write"<td width=100> 开发完成日期 </td>"
response.write"<td width=100> 测试完成日期</td>"
response.write"<td width=100> 正式上线</td></tr>"
dim MAJOR_IDEA,APPLY_TIME_start,APPLY_TIME_end,WISH_FINISH_TIME_start,WISH_FINISH_TIME_end,IT_UNDERTAKER,PHASE
MAJOR_IDEA=Trim(request.form("MAJOR_IDEA"))
APPLY_TIME_start=Trim(request.form("APPLY_TIME_start"))
APPLY_TIME_end=Trim(request.form("APPLY_TIME_end"))
WISH_FINISH_TIME_start=Trim(request.form("WISH_FINISH_TIME_start"))
WISH_FINISH_TIME_end=Trim(request.form("WISH_FINISH_TIME_end"))
IT_UNDERTAKER=Trim(request.form("IT_UNDERTAKER"))
PHASE=Trim(request.form("PHASE"))
Dim Rs,Sql
Set Rs = server.CreateObject("Adodb.Recordset")
if request("flag")="Q" then
sql="select APPLY_DEPARTMENT,MAJOR_IDEA,IT_UNDERTAKER,TOTESTTIME,RequireDate,TOTESTTIME,AnalysDate,CodeDate,TestDate,FINISH_TIME from songzw.REQUIRE_BILL where 1=1"
if len(MAJOR_IDEA)>0 then
sql=sql &" and MAJOR_IDEA like '%"& MAJOR_IDEA &"%'"
end if
if len(APPLY_TIME_start)>1 then
sql=sql &" and APPLY_TIME >='"& APPLY_TIME_start &"'"
end if
if len(APPLY_TIME_end)>1 then
sql=sql&" and APPLY_TIME <='"& APPLY_TIME_end &"'"
end if
if len( WISH_FINISH_TIME_start)>1 then
sql=sql&" and WISH_FINISH_TIME >='"& WISH_FINISH_TIME_start &"'"
end if
if len(WISH_FINISH_TIME_end)>1 then
sql=sql&" and APPLY_TIME <='"& WISH_FINISH_TIME_end &"'"
end if
if len(IT_UNDERTAKER)>1 then
sql=sql&" and IT_UNDERTAKE = '"& IT_UNDERTAKE &"'"
end if
if len(PHASE)>3 then
sql=sql&" and PHASE='"& PHASE &"'"
end if
sql=sql & " order by APPLY_TIME desc"
Rs.open SQL,CONN,1,1
if Not rs.Eof then
Rs.MoveFirst
else
response.Write("需求单不存在")
end if

Do while Not rs.Eof
nAPPLY_DEPARTMENT=trim(rs.fields("APPLY_DEPARTMENT"))
nMAJOR_IDEA=trim(rs.fields("MAJOR_IDEA"))
nIT_UNDERTAKER=trim(rs.fields("IT_UNDERTAKER"))
nTOTESTTIME=trim(rs.fields("TOTESTTIME"))
nRequireDate=trim(rs.fields("RequireDate"))
nAnalysDate=trim(rs.fields("AnalysDate"))
nCodeDate=trim(rs.fields("CodeDate"))
nTestDate=trim(rs.fields("TestDate"))
nFINISH_TIME=trim(rs.fields("FINISH_TIME"))


response.write"<tr>"
response.write"<td width=100>" & nAPPLY_DEPARTMENT & "</td>"
response.write"<td width=100>" & nMAJOR_IDEA & "</td>"
response.write"<td width=100>" & nIT_UNDERTAKER & "</td>"
response.write"<td width=100>" & nTOTESTTIME & "</td>"
response.write"<td width=100>" & nRequireDate & "</td>"
response.write"<td width=100>" & nAnalysDate & "</td>"
response.write"<td width=100>" & nCodeDate & "</td>"
response.write"<td width=100>" & nTestDate & "</td>"
response.write"<td width=100>" & nFINISH_TIME & "</td></tr>"
Rs.MoveNext
Loop
end if
%>

</table>
</form>
</body>
</html>

<script language="vbscript">
dispose_history.MAJOR_IDEA.value="<%=MAJOR_IDEA%>"
dispose_history.APPLY_TIME_start.value="<%=APPLY_TIME_start%>"
dispose_history.APPLY_TIME_end.value="<%=APPLY_TIME_end%>"
dispose_history.WISH_FINISH_TIME_start.value="<%=WISH_FINISH_TIME_start%>"
dispose_history.WISH_FINISH_TIME_end.value="<%=WISH_FINISH_TIME_end%>"
dispose_history. IT_UNDERTAKER.value="<%= IT_UNDERTAKER%>"
dispose_history.PHASE.value="<%=PHASE%>"
</script>


<script language="vbscript" >
sub select1_onclick
if dispose_history.MAJOR_IDEA.value="" and dispose_history.APPLY_TIME_start.value="" and dispose_history.APPLY_TIME_end.value="" and dispose_history.WISH_FINISH_TIME_start.value="" and dispose_history.WISH_FINISH_TIME_end.value="" and dispose_history.IT_UNDERTAKER.value="" and dispose_history.PHASE.value="" then
MsgBox "查询条件不能为空,至少需要输入一个查询条件!",78,"需求单系统查询"
dispose_history.MAJOR_IDEA.focus
exit sub
end if
dispose_history.flag.value="Q"
dispose_history.submit
end sub
</script>


<script>
function show()
{
window.document.dispose_history.MAJOR_IDEA.value=""
window.document.dispose_history.APPLY_TIME_start.value=""
window.document.dispose_history.APPLY_TIME_end.value=""
window.document.dispose_history.WISH_FINISH_TIME_start.value=""
window.document.dispose_history.WISH_FINISH_TIME_end.value=""
window.document.dispose_history.IT_UNDERTAKER.value=""
window.document.dispose_history.PHASE.value=""
}
</script>
<%
set Rs=nothing
Conn.close
Set Conn=nothing
%>



学习ASP中.....难啊......
2007-07-18 09:45



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-155635-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.078617 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved