太原到北京旅游攻略:access连接问题

来源:百度文库 编辑:查人人中国名人网 时间:2024/05/06 02:04:16
Set Rs=Server.CreateObject("ADODB.Recordset")
Sql = "select * from YuQaIFS_Hotel where Hotel_name = '"&Name&"'"
Rs.open sql,conn,1,3
If not Rs.eof then
Response.write"<script language=JavaScript>{window.alert('对不起,该酒店名称已经存在,请重新输入');window.location.href='javascript:history.go(-1)'}</script>"
Else
Rs.addnew
Rs("Hotel_name")=trim(request("a"))
Rs("Hotel_rank")=trim(request("b"))
Rs("Hotel_tdj")=trim(request("c"))
Rs("Hotel_skj")=trim(request("d"))
Rs("Hotel_msj")=trim(request("e"))
Rs("Hotel_ctbz")=trim(request("f"))
Rs.update
Rs.close
Set rs = nothing
response.write"<script language=JavaScript>{window.alert('您成功的添加了一条酒店信息');window.location.href='hotel.asp?action=1'}</script>"
End if

If not Rs.eof then 这句话怎么理解?

如果RS集不空则执行IF块内的内容