大家帮忙啊,谢谢
<% name=request.form("name")
sex=request.form("sex")
age=request.form("age")
note=request.form("note")
set conn=server.createobject("adodb.connection")
conn.open "driver={microsoft access driver (*.mdb)};dbq="&server.mappath("sj1.mdb")
sqlstr="select * from test"
set rs=server.CreateObject("adodb.recordset")
rs.open sqlstr,conn,1,3
if rs("name")<>name then
rs.addnew
rs("name").value=name
rs("sex").value=sex
rs("age").value=age
rs("note").value=note
rs.update
rs.close
conn.close
set rs=nothing
set conn=nothing
response.write "记录添加成功!"
else
rs.close
conn.close
set rs=nothing
set conn=nothing
response.write "失败!"
end if
%>
这样的代码,为啥执行ELSE后的语句出错呢
而ELSE前的语句正确呢