请问一下,为什么我在表单写入时,两项就可以,再多两项就不行了。怎么办
<%dim exp_title,exp_people
if request("exp_title")="" then
response.write "<script language=JavaScript>" & chr(13) & "alert('请输入实验名!');" & "history.back()" & "</script>"
Response.End
end if
if request("exp_people")="" then
response.write "<script language=JavaScript>" & chr(13) & "alert('请输入实验人!');" & "history.back()" & "</script>"
Response.End
end if
exp_title=request("exp_title")
exp_people=request("exp_people")
dim sql
dim rs
dim conn
set rs=server.createobject("adodb.recordset")
conn = "DBQ=" + server.mappath("baogao.mdb") + ";DefaultDir=;DRIVER={Microsoft Access Driver (*.mdb)};"
sql="insert into baogao(exp_title,exp_people) values('"&exp_title&"','"&exp_people&"')"
rs.Open sql,conn,3,3
Response.Write "记录添加成功!"
%>
以上可以写入数据库
<%
dim exp_title,exp_people,student_number,exp_teacher
if request("exp_title")="" then
response.write "<script language=JavaScript>" & chr(13) & "alert('请输入实验名!');" & "history.back()" & "</script>"
Response.End
end if
if request("student_number")="" then
response.write "<script language=JavaScript>" & chr(13) & "alert('请输入学号!');" & "history.back()" & "</script>"
Response.End
end if
exp_title=request("exp_title")
exp_people=request("exp_people")
student_number=request("student_number")
exp_teacher=request("exp_teacher")
dim sql
dim rs
dim conn
set rs=server.createobject("adodb.recordset")
conn = "DBQ=" + server.mappath("baogao.mdb") + ";DefaultDir=;DRIVER={Microsoft Access Driver (*.mdb)};"
sql="insert into baogao(exp_title,exp_people,exp_people,student_number,exp_teacher) values('"&exp_title&"','"&exp_people&"','"&student_number&",'"&exp_teacher&"'')"
rs.Open sql,conn,3,3
Response.Write "记录添加成功!"
%>
这个就不可以了,