| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 326 人关注过本帖
标题:数据库操作的问题
取消只看楼主 加入收藏
cxt11
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2007-4-30
收藏
 问题点数:0 回复次数:0 
数据库操作的问题

<%if rs("SMT_key1")=1 then%><a href=yp.asp?id=<%=rs("SMT_id")%>&key=0&action=key&cha=<%=request("cha")%>&chag=<%=request("chag")%>&word=<%=request("word")%>&key1=<%=request("key1")%>&key2=<%=request("key2")%>&page=<%=page%>>开通</a><%else%><a href=yp.asp?id=<%=rs("SMT_id")%>&key=1&action=key&cha=<%=request("cha")%>&chag=<%=request("chag")%>&word=<%=request("word")%>&key1=<%=request("key1")%>&key2=<%=request("key2")%>&page=<%=page%>><font color=red>关闭</font></a><%end if%>

说明:当SMT_key1的数值key1=1的时候,显示的连接为开通。当SMT_key1的数值key1=2的时候,显示的连接为关闭。

问题是数据库无法更新,请大家帮帮忙看看啊?什么问题呀?

该页面代码如下:

<%dbdns="../../"%>
<!--#include file="../../inc/conn.asp"-->
<!--#include file="../cook.asp"-->
<%if fla1<>1 then
response.write "<script>alert('操作权限出错,您没有权限操作些功能');history.go(-1);</Script>"
Response.End
end if%>
<%cha=request("cha")
if request("Submit")="删 除" then%>
<%elseif request("Submit")="审 核" then%>
<%end if

if request("action")="key" then%>
<%
end if%>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<script>
function CheckAll(form) {
for (var i=0;i<form.elements.length;i++) {
var e = form.elements[i];
if (e.name != 'chkall') e.checked = form.chkall.checked;
}
}
</script>
<script>
function oa_tool1(){
window.parent.mm.rows="200,10,*";
}
</script>
<%=citycss%>
<body style="margin:5">
<table width="99%" border="1" align="center" cellpadding="0" cellspacing="0" bordercolorlight="#cccccc" bordercolordark="#FFFFFF">
<form name="form1" method="post" action="yp.asp">
<tr align=center bgcolor=#efefef><td height=25 align=center><input type="text" name="word">  <input type="submit" name="Submit" value="企业搜索"> <a href="yp.asp?cha=yes">10天内到期</a> <a href="yp.asp?key1=false">已关闭</a> <a href="yp.asp?key2=0">待审</a> <a href="yp.asp?key2=1">正常</a> <a href="yp.asp?key2=2">到期</a> <a href="yp.asp?key2=3">推荐</a> <a href="yp.asp">所有</a></td></tr>
<tr align=center bgcolor=#efefef><td height=25 align=center>
<a href="yp.asp?vip=1">VIP申请中</a>
<a href="yp.asp?vip=2">VIP正式</a>
<a href="yp.asp?vip=3">试用申请中</a>
<a href="yp.asp?vip=4">试用正试</a>
<a href="yp.asp?vip=5">普通申请中</a>
<a href="yp.asp?vip=6">普通正试</a>
</td></tr>
</form>
</table>
<table width="99%" border="1" align="center" cellpadding="0" cellspacing="0" bordercolorlight="#cccccc" bordercolordark="#FFFFFF">
<form name="from1" method="post" action="yp.asp?word=<%=request("word")%>&vip=<%=request("vip")%>&cha=<%=request("cha")%>&chag=<%=request("chag")%>&key1=<%=request("key1")%>&key2=<%=request("key2")%>">
<tr align=center bgcolor=#efefef>
<%if request("word")<>"" then
sql= "select * from SMT_yp where SMT_coname like'%"&request("word")&"%' order by SMT_id desc"
elseif request("vip")<>"" then
sql="select * from SMT_yp where SMT_vip="&request("vip")&" and (SMT_key=1 or SMT_key=3) and SMT_ktdate>"&SMT_citydate&" order by SMT_id desc"
elseif request("cha")<>"" then
sql= "select * from SMT_yp where SMT_ktdate<("&SMT_citydate&"+10) and (SMT_ktdate-"&SMT_citydate&")>0 order by SMT_id desc"
elseif request("key1")<>"" then
sql="select * from SMT_yp where SMT_key1=0 order by SMT_id desc"
elseif request("key2")<>"" then
sql="select * from SMT_yp where SMT_key="&request("key2")&" order by SMT_id desc"
else
sql="select * from SMT_yp order by SMT_id desc"
end if
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
if rs.eof and rs.bof then
response.write "暂无内容"
else
'分页的实现
listnum=23
Rs.pagesize=listnum
page=Request("page")
if (page-Rs.pagecount) > 0 then
page=Rs.pagecount
elseif page = "" or page < 1 then
page = 1
end if
Rs.absolutepage=page
'编号的实现
j=rs.recordcount
j=j-(page-1)*listnum
i=0
nn=request("page")
if nn="" then
n=0
else
nn=nn-1
n=listnum*nn
end if%>
<td width="4%" height=22>编号</td>
<td>企业名称<font color=red>(点击修改)</font></td>
<td width="4%">来源</td>
<td width="4%">查看</td>
<td width="7%">登录/点击</td>
<td width="9%">开始时间</td>
<td width="9%">到期时间</td>
<td width="8%">剩余时间</td>
<td width="4%">状态</td>
<td width="4%">操作</td>
<td width="4%">管理</td>
<td width="4%">选择</td>
</tr>
<%do while not rs.eof and i<listnum
n=n+1
zdate=cdate(year(rs("SMT_date"))&"-"&month(rs("SMT_date"))&"-"&day(rs("SMT_date")))
ktdate=cdate(year(rs("SMT_ktdate"))&"-"&month(rs("SMT_ktdate"))&"-"&day(rs("SMT_ktdate")))
ksdate=cdate(year(rs("SMT_ksdate"))&"-"&month(rs("SMT_ksdate"))&"-"&day(rs("SMT_ksdate")))
tian=ktdate-date()
ztian=ktdate-ksdate
page=request("page")
if page="" then page=1
vip=rs("SMT_vip")
if vip=1 then
aaa="<font color=red>[VIP申请中]</font>"
elseif vip=2 then
aaa="<font color=red><strong>[VIP会员]</strong></font>"
elseif vip=3 then
aaa="<font color=green>[试用申请中]</font>"
elseif vip=4 then
aaa="<font color=green><strong>[试用会员]</strong></font>"
elseif vip=5 then
aaa="<font color=blue>[普通申请中]</font>"
elseif vip=6 then
aaa="<font color=blue><strong>[普通会员]</strong></font>"
end if
%>
<tr align=center height=22>
<td><%=n%></td>
<td align=left>&nbsp;<a href=chkadmin.asp?user=<%=rs("SMT_user")%>&pass=<%=rs("SMT_pass")%>><%=rs("SMT_coname")%></a> <%=aaa%></td>
<td><%if rs("SMT_enrol")=0 then%>前台<%elseif rs("SMT_enrol")=1 then%><font color=blue>代理</font><%end if%></td>
<%goname=rs("SMT_user")
goid=rs("SMT_id")%>
<!--#include file="../../dns/dns.asp"-->
<td><a href="<%=usertwourl%>" target=_blank>查看</a></td>
<td><%=rs("SMT_loginhtc")%><font color=red>|</font><%=rs("SMT_htc")%></td>
<td><%=ksdate%></td>
<td><font title="<%="注册时间:"&rs("SMT_date")&vbcrlf&"开始时间:"&rs("SMT_ksdate")&vbcrlf&"结束时间:"&rs("SMT_ktdate")%>"><%=ktdate%></font></td>
<%if tian<=10 and tian>=0 then
stian="<strong><font color=red>"&tian&"</font></strong>"
elseif tian<0 then
stian="<strong><font color=blue>-</font></strong>"
else
stian="<strong>"&tian&"</strong>"
end if%>
<td title="剩余天数/服务天数<%=vbCrLf%>“-”表示已过期"><%=stian%>/<%=ztian%></td>
<td><%if rs("SMT_key")=0 then%><font color=ff9900>待审</font><%elseif rs("SMT_key")=1 then%>正常<%elseif rs("SMT_key")=2 then%><font color=red>到期</font><%elseif rs("SMT_key")=3 then%><font color=green>推荐</font><%end if%></td>
<td><a href=lx.asp?id=<%=rs("SMT_id")%> onclick="oa_tool1()" target=top>操作</a></td>
<td><%if rs("SMT_key1")=1 then%><a href=yp.asp?id=<%=rs("SMT_id")%>&key=0&action=key&cha=<%=request("cha")%>&chag=<%=request("chag")%>&word=<%=request("word")%>&key1=<%=request("key1")%>&key2=<%=request("key2")%>&page=<%=page%>>开通</a><%else%><a href=yp.asp?id=<%=rs("SMT_id")%>&key=1&action=key&cha=<%=request("cha")%>&chag=<%=request("chag")%>&word=<%=request("word")%>&key1=<%=request("key1")%>&key2=<%=request("key2")%>&page=<%=page%>><font color=red>关闭</font></a><%end if%></td>
<td><input type="checkbox" name="ID" value="<%=rs("SMT_id")%>" style="border:0"></td>
</tr>
<%rs.movenext
i=i+1
j=j-1
loop%>
<tr>
<%filename="yp.asp?word="&request("word")&"&vip="&request("vip")&"&cha="&request("cha")&"&chag="&request("chag")&"&key1="&request("key1")&"&key2="&request("key2")&""%>
<td colspan=12 height=20 align=right bgcolor=#cccccc><%=Rs.recordcount%> 个企业&nbsp;&nbsp;<%=listnum%> 个企业/页&nbsp;&nbsp;共 <%=Rs.pagecount%> 页
<% if page=1 then %>
<%else%>
<a href=<%=filename%>><strong>|<<</strong></a>&nbsp;
<a href=<%=filename%>&page=<%=page-1%>><strong><<</strong></a>&nbsp;
<a href=<%=filename%>&page=<%=page-1%>><b>[<%=page-1%>]</b></a>&nbsp;
<%end if%><% if Rs.pagecount=1 then %><%else%><b>[<%=page%>]</b><%end if%>
<% if Rs.pagecount-page <> 0 then %>
<a href=<%=filename%>&page=<%=page+1%>><b>[<%=page+1%>]</b></a>&nbsp;
<a href=<%=filename%>&page=<%=page+1%>><strong>>></strong></a>&nbsp;
<a href=<%=filename%>&page=<%=Rs.pagecount%>><strong>>>|</strong></a>&nbsp;
<%end if%> <input name="chkall" type="checkbox" id="chkall" value="select" onclick="CheckAll(this.form)" style="border:0">全选 <input type="submit" name="Submit" value="审 核"<%if request("key2")<>0 or request("key2")="" then%> disabled<%end if%>> <input type="submit" name="Submit" value="删 除">&nbsp;&nbsp;</td>
<%end if%></tr>
</form>
</table>

搜索更多相关主题的帖子: 数据库 
2007-04-30 11:49
快速回复:数据库操作的问题
数据加载中...
 
   



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

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