换了ACCESS就出问题,十分头大,请高手帮忙看一下原因,谢谢!
代码如下:if request.Form("B1")<>"" then
unitname=request.form("unitname")
username=trim(request.form("user"))
password=request.form("pass")
sql0 = "select UNIT_user from unit where UNIT_user='"&username&"'"
Set rs0 = Server.CreateObject("ADODB.RecordSet")
rs0.Open sql0,conn,1,1
if not rs0.eof then
Response.write "<script language=javascript>"
Response.write "alert('系统里已经有相同的用户名,请重新填写用户名!');"
Response.write "history.back();"
Response.write "</script>"
set rs0=nothing
set conn=nothing
end if
conn.Execute"insert into unit(UNIT_name,UNIT_user,UNIT_pass)Values('"&unitname&"','"&username&"','"&password&"')"
Response.Redirect"admin_unit.asp"
end if
问题描述:连接sql数据库的时候运转正常,可以弹出警告框,换成了ACCESS后就弹不出警告框了,但也不会执行写入数据库语句。