| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 406 人关注过本帖
标题:更新数据库的问题,急
只看楼主 加入收藏
kgdipbyve
Rank: 2
等 级:论坛游民
帖 子:346
专家分:35
注 册:2008-5-4
结帖率:92.31%
收藏
 问题点数:0 回复次数:1 
更新数据库的问题,急
<%dbdns="../"%>
<!--#include file="../inc.asp"-->


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.
<html xmlns="http://www.
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<link href="../Style/style.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
body {
    margin-left: 0px;
    margin-top: 0px;
    margin-right: 0px;
    margin-bottom: 0px;
}
-->
</style></head>

<body>

<table width="100%" border="0" cellpadding="0" cellspacing="0" class="bgnew">
  
  <tr>
     <td height="600" valign="middle">
    
     <table width="100%" border="0" cellspacing="0" cellpadding="0">
       <%
  session("zp_cty")=replace(trim(Request.QueryString("zp_cty")),"'","''")
  zp_cty=replace(trim(Request.QueryString("zp_cty")),"'","''")
   set rs=Server.CreateObject("adodb.recordset")
  sql="Select * from [job_zp] where zp_cty='"&zp_cty&"' and zp_zt=true order by zp_id desc"
  rs.Open sql,conn,3,3
  if rs.eof then
  Response.write("<script language='javascript'>alert('该区域暂无招聘信息!');location.href='index1.asp';</script>")
  Response.End
  end if
  rs.pagesize=9
  pszie=rs.pagesize
  totalrecord=rs.RecordCount
  page=Cint(Request("page"))
  if totalrecord mod pszie=0 then
  totalpage=totalrecord\psize
  else
  totalpage=totalrecord\pszie+1
   end if
  if page=0 then
  page=1
  end if
  if totalrecord>0 then
  currentpage=page
  rs.absolutepage=currentpage
  end if
  for i=1 to 3
  if rs.eof then
  exit for
  end if
  %>
       <tr>
         <% for j=1 to 3
            if rs.eof then
            exit for
            end if
            %>
         <td height="155">
        
         <table width="224" height="142" border="0" align="center" cellpadding="0" cellspacing="0">
             <tr>
               <td height="114" align="center" valign="middle" background="images/btn.gif">
                   
               <table width="96%" border="0" align="center" cellpadding="0" cellspacing="0">
               <%
                    m=rs("zp_dategq")
                    hou=rs("zp_date")
                    hours=DateDiff("h",hou, Now)
                    u=m-hours
                    if u>0 then
                    %>
                <tr>
                     <td width="69" height="30" align="center" valign="middle">&nbsp;</td>
                     <td width="155" height="50" class="topcenterwrite"><a href="msgg.asp?job_addtwo=<%=rs("zp_qu")%>&job_addone=<%=zp_cty%>&job_leibai=<%=rs("zp_id")%>&JOB_coname=<%=rs("zp_name")%>"><%=rs("zp_name")%></a></td>
                   </tr>
                   <tr>
                     <td align="right" class="rootcnet">主办单位:</td>
                     <td height="25" class="topcenterwrite"><%=left(rs("zp_gong"),9)%></td>
                   </tr>
                   <tr>
                     <td align="right" class="rootcnet">地址:</td>
                     <td height="25" class="center"><%=rs("zp_address")%>
                    </td>
                   </tr>
                   <tr>
                   
                   
                    <td height="25" colspan="2" align="center">招聘会剩余时间还有:<font color="ff0000"><%=u%></font>小时</td>
                    
                    </tr>
          <%else
               zp_id=replace(trim(rs("zp_id")),"'","''")
               set rsa= Server.CreateObject("adodb.recordset")
               sqla="select * from [job_zp] where zp_id="&zp_id
               rsa.open sqla,conn,3,3
               rsa("zp_zt")=false
               rsa.Update()
               rsa.Close
               set rsa=nothing
               end if
                    %>
               </table>
              </td>
             </tr>
         </table>
         </td>
         <%
        rs.MoveNext
        next
        next
        set rs=nothing
        %>
       </tr>
     </table>
       <table width="100%" border="0" cellspacing="0" cellpadding="0">
         <tr>
           <td align="right" valign="bottom">
           <%
           if totalpage>1 then
           %>
    当前是:[<font color="#ff0000"><%=currentpage%></font>]页&nbsp;总页:[<font color="#ff0000"><%=totalpage%></font>]页
      <% if currentpage>1 then
      Response.write"<a href=msg.asp?zp_cty="&session("zp_cty")&"&page="&"1"&">首页</a>"
    
      else
      Response.Write("<font color=#0d313d>首页</font>")
      end if
      %>
     |
      <%if currentpage>1 then
      Response.write("<a href='msg.asp?zp_cty="&session("zp_cty")&"&page="&cstr(totalpage-1)&"'>上一页</a>")
    
      else
      Response.write("<font color=#0d313d>上一页</font>")
      end if
      %>|
      <%
      if currentpage<totalpage then
      Response.write("<a href='msg.asp?zp_cty="&session("zp_cty")&"&page="&cstr(currentpage+1)&"'>下一页    </a>")
      else
      Response.write("<font color=#0d313d>下一页</font>")
      end if
      %>
      |
      <%if currentpage=totalpage then
      Response.Write("<font color=#0d313d>末页</font>")
      else
      Response.write("<a href='msg.asp?zp_cty="&session("zp_cty")&"&page="&cstr(totalpage)&"'>末页    </a>")
    
      end if
      %>    <%
      end if
      %>&nbsp;</td>
         </tr>
    </table>
    
    </td>
  </tr>
</table>
</body>
</html>
-----------------------------
这个代码要按F5 2次才能把要得到的消息刷新出来,怎么才能先让他先刷新数据市库里的信息,在得到我想要的信息。
搜索更多相关主题的帖子: 数据库 
2008-11-15 09:31
kgdipbyve
Rank: 2
等 级:论坛游民
帖 子:346
专家分:35
注 册:2008-5-4
收藏
得分:0 
搞定了,加判断语句<%dbdns="../"%>
<!--#include file="../inc.asp"-->


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.
<html xmlns="http://www.
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<link href="../Style/style.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
body {
    margin-left: 0px;
    margin-top: 0px;
    margin-right: 0px;
    margin-bottom: 0px;
}
-->
</style></head>

<body>

<table width="100%" border="0" cellpadding="0" cellspacing="0" class="bgnew">
  
  <tr>
     <td height="600" valign="middle">
    
     <table width="100%" border="0" cellspacing="0" cellpadding="0">
       <%
  session("zp_cty")=replace(trim(Request.QueryString("zp_cty")),"'","''")
  zp_cty=replace(trim(Request.QueryString("zp_cty")),"'","''")
   set rs1=Server.CreateObject("adodb.recordset")
   sql1="select * from [job_zp] where zp_cty='"&zp_cty&"'"
   do while not rs1.eof
   rs1.open sql1,conn,1,3
   m=rs1("zp_dategq")
    hou=rs1("zp_date")
    hours=DateDiff("h",hou, Now)
    u=m-hours
    if u<1 then
     zp_id=replace(trim(rs1("zp_id")),"'","''")
               set rsa= Server.CreateObject("adodb.recordset")
               sqla="select * from [job_zp] where zp_id="&zp_id
               rsa.open sqla,conn,3,3
               rsa("zp_zt")=false
               rsa.Update()
                rsa.Close
               set rsa=nothing
             end if
             rs1.movenext
             loop
             rs1.Close
             set rs1=nothing
      set rs=Server.CreateObject("adodb.recordset")
  sql="Select * from [job_zp] where zp_cty='"&zp_cty&"' and zp_zt=true order by zp_id desc"
  rs.Open sql,conn,3,3
  if rs.eof then
  Response.write("<script language='javascript'>alert('该区域暂无招聘信息!');location.href='index1.asp';</script>")
  Response.End
  end if
  rs.pagesize=9
  pszie=rs.pagesize
  totalrecord=rs.RecordCount
  page=Cint(Request("page"))
  if totalrecord mod pszie=0 then
  totalpage=totalrecord\psize
  else
  totalpage=totalrecord\pszie+1
   end if
  if page=0 then
  page=1
  end if
  if totalrecord>0 then
  currentpage=page
  rs.absolutepage=currentpage
  end if
  for i=1 to 3
  if rs.eof then
  exit for
  end if
  %>
       <tr>
         <% for j=1 to 3
            if rs.eof then
            exit for
            end if
            %>
         <td height="155">
         <%
         if u<0 then
         Response.Write("<script language=javascript>alert('暂无相关招聘!');this.location='index1.asp';</script>")
         else
         %>
         <table width="224" height="142" border="0" align="center" cellpadding="0" cellspacing="0">
             <tr>
               <td height="114" align="center" valign="middle" background="images/btn.gif">
                   
               <table width="96%" border="0" align="center" cellpadding="0" cellspacing="0">
            
                <tr>
                     <td width="69" height="30" align="center" valign="middle">&nbsp;</td>
                     <td width="155" height="50" class="topcenterwrite"><a href="msgg.asp?job_addtwo=<%=rs("zp_qu")%>&job_addone=<%=zp_cty%>&job_leibai=<%=rs("zp_id")%>&JOB_coname=<%=rs("zp_name")%>"><%=rs("zp_name")%></a></td>
                   </tr>
                   <tr>
                     <td align="right" class="rootcnet">主办单位:</td>
                     <td height="25" class="topcenterwrite"><%=left(rs("zp_gong"),9)%></td>
                   </tr>
                   <tr>
                     <td align="right" class="rootcnet">地址:</td>
                     <td height="25" class="center"><%=rs("zp_address")%>
                    </td>
                   </tr>
                   <tr>
                   
                   
                    <td height="25" colspan="2" align="center">招聘会剩余时间还有:<font color="ff0000"><%=u%></font>小时</td>
                    
                    </tr>
        
               </table>
              </td>
             </tr>
         </table>
         <%
         end if
         %>
         </td>
         <%
        rs.MoveNext
        next
        next
        set rs=nothing
        %>
       </tr>
     </table>
       <table width="100%" border="0" cellspacing="0" cellpadding="0">
         <tr>
           <td align="right" valign="bottom">
           <%
           if totalpage>1 then
           %>
    当前是:[<font color="#ff0000"><%=currentpage%></font>]页&nbsp;总页:[<font color="#ff0000"><%=totalpage%></font>]页
      <% if currentpage>1 then
      Response.write"<a href=msg.asp?zp_cty="&session("zp_cty")&"&page="&"1"&">首页</a>"
    
      else
      Response.Write("<font color=#0d313d>首页</font>")
      end if
      %>
     |
      <%if currentpage>1 then
      Response.write("<a href='msg.asp?zp_cty="&session("zp_cty")&"&page="&cstr(totalpage-1)&"'>上一页</a>")
    
      else
      Response.write("<font color=#0d313d>上一页</font>")
      end if
      %>|
      <%
      if currentpage<totalpage then
      Response.write("<a href='msg.asp?zp_cty="&session("zp_cty")&"&page="&cstr(currentpage+1)&"'>下一页    </a>")
      else
      Response.write("<font color=#0d313d>下一页</font>")
      end if
      %>
      |
      <%if currentpage=totalpage then
      Response.Write("<font color=#0d313d>末页</font>")
      else
      Response.write("<a href='msg.asp?zp_cty="&session("zp_cty")&"&page="&cstr(totalpage)&"'>末页    </a>")
    
      end if
      %>    <%
      end if
      %>&nbsp;</td>
         </tr>
    </table>

    </td>
  </tr>
</table>
</body>
</html>
2008-11-15 10:33
快速回复:更新数据库的问题,急
数据加载中...
 
   



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

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