主题:网页提示数据写入成功,但数据库中没有数据!
<%
dim UserName,Password,PwdConfirm,Sex,Email,HomePage,CompanyName,QQ,Postcode,Phone,Fax
UserName=trim(request("UserName"))
Password=trim(request("Password"))
PwdConfirm=trim(request("PwdConfirm"))
Sex=trim(Request("Sex"))
Email=trim(request("Email"))
HomePage=trim(request("HomePage"))
CompanyName=trim(request("CompanyName"))
QQ=trim(request("QQ"))
Postcode=trim(request("Postcode"))
Phone=trim(request("Phone"))
Mobile=trim(request("Mobile"))
Fax=trim(request("Fax"))
if UserName="" or strLength(UserName)>14 or strLength(UserName)<4 then
founderr=true
errmsg=errmsg & "<br><li>请输入用户名(不能大于14小于4)</li>"
else
if Instr(UserName,"=")>0 or Instr(UserName,"%")>0 or Instr(UserName,chr(32))>0 or Instr(UserName,"?")>0 or Instr(UserName,"&")>0 or Instr(UserName,";")>0 or Instr(UserName,",")>0 or Instr(UserName,"'")>0 or Instr(UserName,",")>0 or Instr(UserName,chr(34))>0 or Instr(UserName,chr(9))>0 or Instr(UserName,"")>0 or Instr(UserName,"$")>0 then
errmsg=errmsg+"<br><li>用户名中含有非法字符</li>"
founderr=true
end if
end if
if Password="" or strLength(Password)>12 or strLength(Password)<6 then
founderr=true
errmsg=errmsg & "<br><li>请输入密码(不能大于12小于6)</li>"
else
if Instr(Password,"=")>0 or Instr(Password,"%")>0 or Instr(Password,chr(32))>0 or Instr(Password,"?")>0 or Instr(Password,"&")>0 or Instr(Password,";")>0 or Instr(Password,",")>0 or Instr(Password,"'")>0 or Instr(Password,",")>0 or Instr(Password,chr(34))>0 or Instr(Password,chr(9))>0 or Instr(Password,"")>0 or Instr(Password,"$")>0 then
errmsg=errmsg+"<br><li>密码中含有非法字符</li>"
founderr=true
end if
end if
if PwdConfirm="" then
founderr=true
errmsg=errmsg & "<br><li>请输入确认密码(不能大于12小于6)</li>"
else
if Password<>PwdConfirm then
founderr=true
errmsg=errmsg & "<br><li>密码和确认密码不一致</li>"
end if
end if
if Sex="" then
founderr=true
errmsg=errmsg & "<br><li>性别不能为空</li>"
else
sex=cint(sex)
if Sex<>0 and Sex<>1 then
Sex=1
end if
end if
if Email="" then
founderr=true
errmsg=errmsg & "<br><li>Email不能为空</li>"
else
if IsValidEmail(Email)=false then
errmsg=errmsg & "<br><li>您的Email有错误</li>"
founderr=true
end if
end if
if Postcode="" then
founderr=true
errmsg=errmsg & "<br><li>邮政编码不能为空</li>"
end if
if Phone="" then
founderr=true
errmsg=errmsg & "<br><li>联系电话不能为空</li>"
end if
dim sqlReg,rsReg
sqlReg="select * from [User] where UserName='" & Username & "'"
set rsReg=server.createobject("adodb.recordset")
rsReg.open sqlReg,conn,1,3
if not(rsReg.bof and rsReg.eof) then
founderr=true
errmsg=errmsg & "<br><li>你注册的用户已经存在!请换一个用户名再试试!</li>"
else
rsReg.addnew
rsReg("UserName")=UserName
rsReg("Password")=md5(Password)
rsReg("Sex")=Sex
rsReg("Email")=Email
rsReg("HomePage")=HomePage
rsReg("CompanyName")=CompanyName
rsReg("QQ")=QQ
rsReg("Postcode")=Postcode
rsReg("Phone")=Phone
rsReg("Mobile")=Mobile
rsReg("Fax")=Fax
rsReg("RegDate")=Now()
rsReg.update
founderr=false
end if
rsReg.close
set rsReg=nothing
end if
%>
提交数据的代码,sql的数据库.是怎么回事
dim UserName,Password,PwdConfirm,Sex,Email,HomePage,CompanyName,QQ,Postcode,Phone,Fax
UserName=trim(request("UserName"))
Password=trim(request("Password"))
PwdConfirm=trim(request("PwdConfirm"))
Sex=trim(Request("Sex"))
Email=trim(request("Email"))
HomePage=trim(request("HomePage"))
CompanyName=trim(request("CompanyName"))
QQ=trim(request("QQ"))
Postcode=trim(request("Postcode"))
Phone=trim(request("Phone"))
Mobile=trim(request("Mobile"))
Fax=trim(request("Fax"))
if UserName="" or strLength(UserName)>14 or strLength(UserName)<4 then
founderr=true
errmsg=errmsg & "<br><li>请输入用户名(不能大于14小于4)</li>"
else
if Instr(UserName,"=")>0 or Instr(UserName,"%")>0 or Instr(UserName,chr(32))>0 or Instr(UserName,"?")>0 or Instr(UserName,"&")>0 or Instr(UserName,";")>0 or Instr(UserName,",")>0 or Instr(UserName,"'")>0 or Instr(UserName,",")>0 or Instr(UserName,chr(34))>0 or Instr(UserName,chr(9))>0 or Instr(UserName,"")>0 or Instr(UserName,"$")>0 then
errmsg=errmsg+"<br><li>用户名中含有非法字符</li>"
founderr=true
end if
end if
if Password="" or strLength(Password)>12 or strLength(Password)<6 then
founderr=true
errmsg=errmsg & "<br><li>请输入密码(不能大于12小于6)</li>"
else
if Instr(Password,"=")>0 or Instr(Password,"%")>0 or Instr(Password,chr(32))>0 or Instr(Password,"?")>0 or Instr(Password,"&")>0 or Instr(Password,";")>0 or Instr(Password,",")>0 or Instr(Password,"'")>0 or Instr(Password,",")>0 or Instr(Password,chr(34))>0 or Instr(Password,chr(9))>0 or Instr(Password,"")>0 or Instr(Password,"$")>0 then
errmsg=errmsg+"<br><li>密码中含有非法字符</li>"
founderr=true
end if
end if
if PwdConfirm="" then
founderr=true
errmsg=errmsg & "<br><li>请输入确认密码(不能大于12小于6)</li>"
else
if Password<>PwdConfirm then
founderr=true
errmsg=errmsg & "<br><li>密码和确认密码不一致</li>"
end if
end if
if Sex="" then
founderr=true
errmsg=errmsg & "<br><li>性别不能为空</li>"
else
sex=cint(sex)
if Sex<>0 and Sex<>1 then
Sex=1
end if
end if
if Email="" then
founderr=true
errmsg=errmsg & "<br><li>Email不能为空</li>"
else
if IsValidEmail(Email)=false then
errmsg=errmsg & "<br><li>您的Email有错误</li>"
founderr=true
end if
end if
if Postcode="" then
founderr=true
errmsg=errmsg & "<br><li>邮政编码不能为空</li>"
end if
if Phone="" then
founderr=true
errmsg=errmsg & "<br><li>联系电话不能为空</li>"
end if
dim sqlReg,rsReg
sqlReg="select * from [User] where UserName='" & Username & "'"
set rsReg=server.createobject("adodb.recordset")
rsReg.open sqlReg,conn,1,3
if not(rsReg.bof and rsReg.eof) then
founderr=true
errmsg=errmsg & "<br><li>你注册的用户已经存在!请换一个用户名再试试!</li>"
else
rsReg.addnew
rsReg("UserName")=UserName
rsReg("Password")=md5(Password)
rsReg("Sex")=Sex
rsReg("Email")=Email
rsReg("HomePage")=HomePage
rsReg("CompanyName")=CompanyName
rsReg("QQ")=QQ
rsReg("Postcode")=Postcode
rsReg("Phone")=Phone
rsReg("Mobile")=Mobile
rsReg("Fax")=Fax
rsReg("RegDate")=Now()
rsReg.update
founderr=false
end if
rsReg.close
set rsReg=nothing
end if
%>
提交数据的代码,sql的数据库.是怎么回事