<%
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”,有空的大哥就帮我看看吧,谢谢了
黑色的字是我运行通过的程序,就是没有分页功能试,运行已经通过了,蓝色是我为了实现分页功能添加的代码,就出错了