有一个小小的判断问题

tjcloving 2003-08-22 04:32:57
有一个需要让用户输入数字的文本框,在数据库里有一个order字段来记录。如果用户
输入了在数据库里已经有的数字,这样怎么进行判断!帮忙写段代码 感谢
...全文
19 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
tjcloving 2003-08-22
  • 打赏
  • 举报
回复
谢谢您 哥们 给分
zhllwarez 2003-08-22
  • 打赏
  • 举报
回复
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<body >
<%
ConnStr=不同的数据库连接字符串不同
Set Rs = Server.CreateObject("adodb.recordset")
sql="select top 1 * from 表 where order='"&Request.form("zsbh")&"'"
Rs.Open Sql,ConnStr
if not rs.eof then
response.write "<script language=javascript>alert('已经存在记录!');history.back();</script>"
response.end
else 做你要做的
end if
Rs.Close()
set Rs=nothing
%>

<form name="form1" method="post" action="本文件.asp">
<input name="zsbh" type="text" id="zsbh" size="20" maxlength="20">
<input type="submit" name="saveme" value="保 存" >
</form>

</body>
</html>

6,184

社区成员

发帖
与我相关
我的任务
社区描述
windows网络管理与配置
社区管理员
  • 网络管理与配置社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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