ASP错误 用的是 end sub ,却说是缺少 if

来源:百度知道 编辑:UC知道 时间:2024/06/08 12:41:51
全部代码如下
<% If Request("action") = "SaveWrite" Then
Call SaveWrite()
End If
%>
<%
Sub SaveWrite()
dim rs3
dim sql
dim hdid
dim riqi
dim hdzt
dim hdlx
dim sfcj
dim kfdx
dim fy
dim hym
dim xh
dim xm
dim email
dim sj
dim times
hdid = trim(request.Form("hdid"))
riqi = trim(request.Form("riqi"))
hdzt = trim(request.Form("hdzt"))
hdlx = trim(request.Form("hdlx"))
sfcj = trim(request.form("radiobutton"))
kfdx = trim(request.Form("kfdx"))
fy = trim(request.Form("fy"))
hym = trim(request.Form("hym"))
xh = trim(request.Form("xh"))
xm = trim(request.Form("xm"))
email = trim(request.Form("email"))
sj = trim(request.Form("sj"))
times = trim(request.Fo

事实上你缺少了一个END IF,看你的这段代码:
if rs3.eof and rs3.bof then
set rs4 =server.createobject("adodb.recordset")
sql1 ="select * from huodongcanjia"
rs4.open sql1,MM_conn_STRING,3,3
rs4.addnew
else
if rs3.eof and rs3.bof then
set rs4 =server.createobject("adodb.recordset")
sql1 ="select * from huodongcanjia where [参加人用户名] = '"& hym&"' and [活动ID]='"& hdid&"'"
rs4.open sql1,MM_conn_STRING,3,3
end if

2个IF 却只有一个END IF不错才怪!

少一个END IF 你自己看一下 有2个 if 却只有一个end if 当然不行咯

ELSEIF 不能分开....