<% Connstr="DBQ="+server.mappath("main.mdb")+";DefaultDir=;DRIVER={Microsoft Access Driver (*.mdb)};DriverId=25;" set conn=server.createobject("adodb.connection") conn.open Connstr
sqlstr="select * from main where usr_name='"&request("usr_name")&"'" set rs=server.CreateObject("adodb.recordset") rs.open sqlstr,conn,1,3 rs.addnew if not rs.eof then response.write"帐号已存在" else response.write"注册成功" end if rs("usr_name")=request("usr_name") rs("usr_pwd")=request("usr_pwd") rs.update rs.close set rs=nothing conn.close set conn=nothing %>