<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%> <% option explicit dim username,userpasswd,user,usersex,usernote,conn,db,rs,sql db="mdb/aaaa.mdb" username=request.form("textname") userpasswd=request.form("textpasswd") user=request.form("textuser") usersex=request.form("sex") usernote=request.form("textnote") Set conn = Server.CreateObject("ADODB.Connection") conn.open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath(db) sql="select * from zhuce where name='"&username&"'" Set rs = Server.CreateObject("ADODB.RecordSet") rs.open sql,conn,1,1 if not rs.eof then %> <style type="text/css"> <!-- .style1 { font-family: "宋体"; font-size: 10pt; } --> </style>
对不起,用户名已经有人用了,请换其他的用户名试一下! <%else sql="insert into zhuce (name,passwd,user,sex,note) values ('"&username&"','"&userpasswd&"','"&user&"','"&usersex&"','"&usernote&"')" conn.Execute(sql) %> <span class="style1">用户<%=username%>添加成功!</span> <% end if rs.close conn.close set conn=nothing %> 为什么提示说我insert into语法错误呢?我检查了半天也没看出来是哪儿错了,能告诉我下么? 谢谢!!!
[此贴子已经被作者于2005-9-23 16:10:30编辑过]