关于提取数据库中双精度值的asp写法

pony1195 2005-01-26 09:19:28
这是一个文章录用系统,页面上是所有文章录用的情况,主要关键是想要提取的是luyong这个,0.2则未录用,0.3录用。点页头那个 只显未录用的文稿 ,就全部显示luyong这个值为0.2的数据,我做了半天怎么提取都不行,老是全部录用没录用都提取出来了。你们看明白,了解了我的想法了没,大家帮帮看下成吗?先谢谢了
以下是这个页面的代码,点那个 只显未录用的文稿 跳转到的 weiru.asp就是显示未录用文稿的。我现在发的是tougao.asp的代码:请看:
<!--#include file="checkUser.asp"-->
<!--#include file="conn.asp"-->
<%
set rs=server.createobject("adodb.recordset")
if request("action")="delete" then
sql="delete * from tougao where id="&request("id")&""
rs.open sql,conn,1,1
response.redirect "tougao.asp"
else
sql="select * from tougao order by id desc"
rs.open sql,conn,1,1
end if
rs.pagesize=50
%>
<html>
<HEAD>
<TITLE>New Document</TITLE>
<META NAME="Generator" CONTENT="Microsoft FrontPage 6.0">
<link href="../img/style.css" rel="stylesheet" type="text/css">
<script>
function openurl(id) { window.open("message1.asp?id="+id,"","height=500,width=760,left=190,top=10,resizable=yes,scrollbars=yes,status=no,toolbar=no,menubar=no,location=no");}
</script>
</HEAD>

<BODY>

<table width="100%" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#005984" class="unnamed1" >
<tbody>
<tr bgcolor="#BFDFFF">
<td height="40" colspan="8" align="middle"> <div align="left"><font color="#FFFFFF"><strong><font color="#003399"> ||
投稿管理|| <a href="weiru.asp">只显未录用的文稿</a> || 只显示未寄出的样刊 || </font></strong></font></div>
<div align="center"></div></td>
</tr>
<tr bgcolor="#E1EFFF">
<td width="8%" align="center"><strong><font color="#003399">状态</font></strong></td>
<td height="30" align="middle" width="10%"><b><font color="#003399">论文编号</font></b></td>
<td height="30" align="middle" width="17%"><div align="center"><strong><font color="#003399">标题</font></strong></div> </td>
<td height="30" align="middle" width="16%"><b><font color="#003399">录用状态</font></b></td>
<td height="30" align="middle" width="14%"><span style="font-family: 宋体">
<font color="#003399" style="font-size: 9pt; font-weight: 700">样刊是否已寄出</font></span></td>
<td width="13%" align="middle"><div align="center"><strong>
<font color="#003399">投稿时间</font></strong></div></td>
<td colspan="2" align="middle"><div align="center"><font color="#003399"><strong>操作</strong></font></div></td>
</tr>
<%
if rs.eof then
response.write "<tr><td colspan=8 align=center bgcolor=""#F0F8FF""><font color=red>暂时还没有留言</font></td></tr>"
else
if request("page")="" then
page=1
else
page=cint(request("page"))
end if
rs.absolutepage=page
for j=1 to rs.pagesize

%>
<tr>
<td align="center" bgcolor="#F0F8FF">
<%
if rs("click")=0 then
a="<font color=red><b>新留言</b></font>"
else
a="已查看"
end if
response.write a
%> </td>
<td height="25" align="center" bgcolor="#F0F8FF" width="10%"> <%=rs("chaid")%></td>
<td height="25" align="center" bgcolor="#F0F8FF" width="17%"><a href="javascript:openurl(<%=rs("id")%>)"><%=rs("company")%></a></td>
<td height="25" align="center" bgcolor="#F0F8FF" width="16%"> <%
if rs("luyong")=0.2 then
%>
<option value="0.2" selected>未录用</option>
<%
end if
%>
<%
if rs("luyong")=0.3 then
%>
<option value="0.3" selected>已录用</option>
<%
end if
%></td>
<td height="25" align="center" bgcolor="#F0F8FF" width="14%"> <%
if rs("yangkan")=0.2 then
%>
<option value="0.2" selected>未寄出</option>
<%
end if
%>
<%
if rs("yangkan")=0.3 then
%>
<option value="0.3" selected>已寄出</option>
<%
end if
%></td>
<td height="25" align="center" bgcolor="#F0F8FF"><%=rs("dateandtime")%></td>
<td width="8%" align="center" bgcolor="#F0F8FF">
<a href="javascript:openurl(<%=rs("id")%>)">查看</a></td>
<td width="8%" height="25" align="center" bgcolor="#F0F8FF"><script language="JavaScript1.2">
<!--
function confirm_delete(){
if (confirm("你确定真的要这么做吗?")){
location.href = "?action=delete&id=<%=rs("id")%>"
}
}
//-->
</script>


<a href="#" onClick='confirm_delete()'>删除</a>
</td>
</tr>
<%
rs.movenext
if rs.eof then
exit for
end if
next
end if
%>
<tr bgcolor="#E1EFFF">
<td height="35" colspan="8" align="middle"><table width="90%" height="20" border="0" align="center" cellpadding="0" cellspacing="0" class="unnamed1">
<tr>
<td>共<font color=red><b><%=rs.pagecount%></b></font>页,当前为第<font color=red><b><%=page%></b></font>页    
转到:
<%for i=1 to rs.pagecount%>
<a href="?page=<%=i%>"><b><%=i%></b></a> 
<%next%>
<%if page>1 then%>
<a href="?page=<%=(page-1)%>"><<<上一页 </a>
<%end if%>
<%if page<rs.pagecount then%>
<a href="?page=<%=(page+1)%>">下一页>>> </a>
<%end if%>
</td>
</tr>
</table></td>
</tr>
</tbody>
</table>


</BODY>
</HTML>
<%
rs.close
conn.close
set conn=nothing
%>
...全文
105 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
pony1195 2005-01-26
  • 打赏
  • 举报
回复
weiru文件如下:
<!--#include file="checkUser.asp"-->
<!--#include file="conn.asp"-->
<%
set rs=server.createobject("adodb.recordset")
if request("action")="delete" then
sql="delete * from tougao where id="&request("id")&""
rs.open sql,conn,1,1
response.redirect "weiru.asp"
else
sql="select * from tougao where luyong='0.2' order by id desc"
rs.open sql,conn,1,2
end if
rs.pagesize=10
%>
<html>
<HEAD>
<TITLE>New Document</TITLE>
<META NAME="Generator" CONTENT="Microsoft FrontPage 6.0">
<link href="../img/style.css" rel="stylesheet" type="text/css">
<script>
function openurl(id) { window.open("message1.asp?id="+id,"","height=500,width=760,left=190,top=10,resizable=yes,scrollbars=yes,status=no,toolbar=no,menubar=no,location=no");}
</script>
</HEAD>

<BODY>

<table width="100%" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#005984" class="unnamed1" >
<tbody>
<tr bgcolor="#BFDFFF">
<td height="40" colspan="7" align="middle"> <div align="left"><font color="#FFFFFF"><strong><font color="#003399"> ||
投稿管理|| <a href="weiru.asp">只显未录用的文稿</a> || 只显示未寄出的样刊 || </font></strong></font></div>
<div align="center"></div></td>
</tr>
<tr bgcolor="#E1EFFF">
<td width="9%" align="center"><strong><font color="#003399">状态</font></strong></td>
<td height="30" align="middle" width="24%"><div align="center"><strong><font color="#003399">标题</font></strong></div> </td>
<td height="30" align="middle" width="17%"><b><font color="#003399">录用状态</font></b></td>
<td height="30" align="middle" width="15%"><span style="font-family: 宋体">
<font color="#003399" style="font-size: 9pt; font-weight: 700">样刊是否已寄出</font></span></td>
<td width="14%" align="middle"><div align="center"><strong>
<font color="#003399">投稿时间</font></strong></div></td>
<td colspan="2" align="middle"><div align="center"><font color="#003399"><strong>操作</strong></font></div></td>
</tr>
<%
if rs.eof then
response.write "<tr><td colspan=8 align=center bgcolor=""#F0F8FF""><font color=red>暂时还没有留言</font></td></tr>"
else
if request("page")="" then
page=1
else
page=cint(request("page"))
end if
rs.absolutepage=page
for j=1 to rs.pagesize

%>
<tr>
<td align="center" bgcolor="#F0F8FF">
<%
if rs("click")=0 then
a="<font color=red><b>新留言</b></font>"
else
a="已查看"
end if
response.write a
%> </td>
<td height="25" align="center" bgcolor="#F0F8FF" width="24%"><a href="javascript:openurl(<%=rs("id")%>)"><%=rs("company")%></a></td>
<td height="25" align="center" bgcolor="#F0F8FF" width="17%"> <%
if rs("luyong")=0.2 then
%>
<option value="0.2" selected>未录用</option>
<%
end if
%>
<%
if rs("luyong")=0.3 then
%>
<option value="0.3" selected>已录用</option>
<%
end if
%></td>
<td height="25" align="center" bgcolor="#F0F8FF" width="15%"> <%
if rs("yangkan")=0.2 then
%>
<option value="0.2" selected>未寄出</option>
<%
end if
%>
<%
if rs("yangkan")=0.3 then
%>
<option value="0.3" selected>已寄出</option>
<%
end if
%></td>
<td height="25" align="center" bgcolor="#F0F8FF"><%=rs("dateandtime")%></td>
<td width="9%" align="center" bgcolor="#F0F8FF">
<a href="javascript:openurl(<%=rs("id")%>)">查看</a></td>
<td width="9%" height="25" align="center" bgcolor="#F0F8FF"><a href="?action=delete&id=<%=rs("id")%>">删除</a></td>
</tr>
<%
rs.movenext
if rs.eof then
exit for
end if
next
end if
%>
<tr bgcolor="#E1EFFF">
<td height="35" colspan="7" align="middle"><table width="90%" height="20" border="0" align="center" cellpadding="0" cellspacing="0" class="unnamed1">
<tr>
<td>共<font color=red><b><%=rs.pagecount%></b></font>页,当前为第<font color=red><b><%=page%></b></font>页    
转到:
<%for i=1 to rs.pagecount%>
<a href="?page=<%=i%>"><b><%=i%></b></a> 
<%next%>
<%if page>1 then%>
<a href="?page=<%=(page-1)%>"><<<上一页 </a>
<%end if%>
<%if page<rs.pagecount then%>
<a href="?page=<%=(page+1)%>">下一页>>> </a>
<%end if%>
</td>
</tr>
</table></td>
</tr>
</tbody>
</table>


</BODY>
</HTML>
<%
rs.close
conn.close
set conn=nothing
%>
kendo7 2005-01-26
  • 打赏
  • 举报
回复
问题在weiru.asp这个文件啊
pony1195 2005-01-26
  • 打赏
  • 举报
回复
<%
set rs=server.createobject("adodb.recordset")
if request("action")="delete" then
sql="select * from tougao where luyong='0.2' order by id desc"
rs.open sql,conn,1,1
response.redirect "weiru.asp"
else
sql="select * from tougao where luyong='0.2' order by id desc"
rs.open sql,conn,1,1
end if
rs.pagesize=10
%>
这样?
报错~
Microsoft OLE DB Provider for ODBC Drivers 错误 '80040e21'

ODBC 驱动程序不支持所需的属性。

/login/weiru.asp,行11
hackate 2005-01-26
  • 打赏
  • 举报
回复
sql="select * from tougao order by id desc"


把这句改成

sql="select * from tougao where luyong='0.2' order by id desc"

这样不就可以了么?
pony1195 2005-01-26
  • 打赏
  • 举报
回复
没人给我参考下吗?

28,390

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧