标题:麻烦各位老师指点
取消只看楼主
贝利
Rank: 1
等 级:新手上路
帖 子:3
专家分:0
注 册:2020-7-5
 问题点数:0 回复次数:1 
麻烦各位老师指点
麻烦各位老师指点一下,红色部分不弹出窗口,是什么原因?虽然不弹出窗口,但能正常运行。

思路是预约信息(时间和预约人)提交后,
先查询库里有没有和时间重复的,如果有就弹出窗口,重新录入
如果没有,再查询库里有没有重名的,如果有就弹出窗口,重新录入
如果都没有重复的,就把提交的信息保存到数据库里。

<%
riqi=Replace(Request.Form("riqi"),"'","''")
lifashi=Replace(Request.Form("lifashi"),"'","''")
shijianduan=Replace(Request.Form("shijianduan"),"'","''")
username=Session("username")
address3 = request.servervariables("REMOTE_ADDR")      
date2=now()
set conn=server.createobject("adodb.connection")
conn.open "driver={microsoft access driver (*.mdb)};dbq="&server.mappath("ip.mdb")
    set rs = conn.execute("select * from ip where riqi=#"&riqi&"#  and shijianduan like '%"&shijianduan&"%' and lifashi like '%"&lifashi&"%'")
     if not rs.eof then
         Response.Write "<script>alert('该时间段已被预约!请约其他时间段!');window.window.location.href='main.asp';</script>"
                 rs.close:set rs = nothing
else
set rs1 = conn.execute("select * from ip where riqi=#"&riqi&"#  and username like '%"&username&"%' and username not like '星辉' and username not like '戈松'")
     if not rs1.eof then

         Response.Write "<script>alert('一天只能预约一次!请先取消今天的预约');window.window.location.href='main.asp';</script>"


                 rs1.close:set rs1 = nothing
         else        
         sql="insert into ip (address3,date2,shijianduan,lifashi,riqi,username,mobile,bumen)values('"&address3&"','"&date2&"','"&shijianduan&"','"&lifashi&"','"&riqi&"','"&Session("username")&"','"&session("mobile")&"','"&session("bumen")&"')"
         conn.execute sql
         conn.close
End If
response.Redirect("main.asp")
rs.close:set rs = nothing
conn.Close:set conn = nothing
End If
%>
搜索更多相关主题的帖子: username and set like conn 
2020-07-05 12:45
贝利
Rank: 1
等 级:新手上路
帖 子:3
专家分:0
注 册:2020-7-5
得分:0 
没有老师帮忙看一下吗🙏🙏🙏
2020-07-13 07:44



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-502394-1-1.html




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

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