对了半天数据库,写了代码有用的就看看
http://bbs.dvbbs.net/dispbbs.asp?BoardID=134&ID=1293510&replyID=2364627&skin=1
username=trim(request("username")) //网站用户注册名,密码,电邮,性别接收
password=request("password")
email=request("email")
Sex=trim(request("Sex"))
db2="bbs/data/Dvbbs7.mdb" //论坛数据库路径
Set conn2 = Server.CreateObject("ADODB.Connection")
connstr2="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath(db2)
'connstr="driver={Microsoft Access Driver (*.mdb)};dbq=" & Server.MapPath(db2)
conn2.Open connstr2
set rs2=server.createobject("adodb.recordset")
Sql2="Select * From [Dv_user] Where Username='"&UserName&"'"
rs2.open sql2,conn2,1,3
if not rs2.eof and not rs2.bof then
response.write "用户已经存在"
response.end
end if
if rs2.eof or rs2.bof then
rs2.addnew
UserJoinTime = Now()
rs2("UserName")=username
rs2("UserPassword")=md5(password,16)
rs2("UserEmail")=email
rs2("Userclass")="注册用户"
rs2("TitlePic")="messages1.gif"
rs2("UserQuesion")="www.pscd.cn"
rs2("UserAnswer")="www.pscd.cn"
rs2("TruePassWord")="5748509MMHo36ODH"
rs2("UserIM")="||||||||||||||||||"
rs2("UserSign")=""
rs2("UserPost")=0
rs2("UserGroupID")="9"
rs2("Lockuser")=0
rs2("UserSex")=1
rs2("UserBirthday")=""
rs2("UserGroup")=""
rs2("JoinDate")=UserJoinTime
rs2("UserFace")="images/userface/image1.gif"
rs2("UserWidth")=Width
rs2("Usertoday")="0|0|0|0|0"
rs2("UserHeight")=height
rs2("UserLogins")=1
rs2("LastLogin")=UserJoinTime
rs2("userWealth")="100"
rs2("userEP")="50"
rs2("usercP")="30"
rs2("UserInfo")="||||||||||||||||||||||||||||||||||||||||||"
rs2("UserSetting")="1|||0|||0"
rs2("UserPower")=0
rs2("UserDel")=0
rs2("UserIsbest")=0
rs2("UserMoney")=0
rs2("UserTicket")=0
rs2("UserFav")="陌生人,我的好友,黑名单"
rs2("IsChallenge")=0
rs2("UserHidden")=0
rs2("UserLastIP")="192.168.0.1"
rs2.Update
end if
response.write "OK!" //还少最新用户名更新,不过用户注册已经完成.