学了快三周了,还是不得行啊~!求救!
这是保存页面哈!
<!--#include file= "conn.asp "-->
<%
dim xue,xingm,xing,qins,dianhua,qiye,put
xue=request.form( "sn ")
sql= "select * from [user] where [学号]= ' "&xue& " ' "
Set rs=Server.CreateObject( "ADODB.Recordset ")
rs.open sql,conn,3,3
if not rs.eof or not rs.bof then
response.write "该用户已存在 "
response.end
else
xingm=request.form( "name ")
xing=request.form( "sex ")
qins=request.form( "bdrm ")
dianhua=request.form( "tel ")
qiye=request.form( "bqq ")
put=request.form( "qq ")
insertsql= "insert into user(学号,姓名,性别,寝室,联系方式,BQQ号,QQ号) values( ' "&xue& " ', ' "&xingm& " ', "&xing& ", ' "&qins& " ', ' "&dianhua& " ',# "&qiye& "#, ' "&put& " ') "
rs.close
set rs=nothing
response.write "欢迎您 "&name& "添加成功! "
end if
%>
他总是提示第八行有问题,希望大家给点意见哈~!我郁闷了!
------解决方案--------------------rs.open sql,conn,1,3
...
insertsql= "insert into [user](学号,姓名,性别,寝室,联系方式,BQQ号,QQ号) values( ' "&xue& " ', ' "&xingm& " ', "&xing& ", ' "&qins& " ', ' "&dianhua& " ',# "&qiye& "#, ' "&put& " ') "
conn.execute insertsql
------解决方案--------------------貌似这行
rs.open sql,conn,3,3
出错提示是啥?
------解决方案--------------------if not(rs.eof and rs.bof) then
insertsql= "insert into user(学号,姓名,性别,寝室,联系方式,BQQ号,QQ号) values( ' "&xue& " ', ' "&xingm& " ', "&xing& ", ' "&qins& " ', ' "&dianhua& " ',# "&qiye& "#, ' "&put& " ') "
rs.open sql,conn,1,3