我想做一个报表的添加功能,在添加的时候需要查询报表的编号是否重复,如果重复就不执行添加,弹出提示窗口,我的程序如下:
dim biaohao1
biaohao1=trim(request("biaohao"))//biaohao是文本框的name
set rs=server.createobject("adodb.recordset")
sql="select * from yuanliao_in_store"
rs.open sql,conn,1,3
我想在这个地方添加一个FOR语句,可是就是不成功,语句如下
for i=1 to rs.recordcount
if rs.eof then exit for
if(biaohao1=(response.write(rs("biaohao")))
{
alert("编号重复!");
return (false);
}
next
rs.close
希望高手速度解围,小弟谢谢了!急。
rs.addnew
rs("chushengdi") = trim(request.Form("chushengdi"))
rs("jiesheng") = trim(request.Form("jiesheng"))
rs("bianhao") = trim(request.Form("bianhao1"))
rs("jigou") = trim(request.Form("jigou"))
rs("uptime") = request.Form("uptime")
rs("jingbanren") = jingbanren
rs("jieshengyuan") = trim(request.Form("jieshengyuan"))
rs("content") = trim(request.Form("content"))
rs.update
response.Write "<script language=javascript>alert('录入成功!');</script>"
response.write "<meta http-equiv=""refresh"" content=""0;url=yuanliao_in_store.asp"">"
response.end
rs.close
set rs=nothing
end sub
跃然一笑