Jump to content

Registration Problem


Recommended Posts

i have following code which add record in database. but it gives error that Cannot update. Database or object is read-only./logon/create.asp, line 29whats wrong in this code??

<%	'Save entered username and password	Username = Request.Form("txtUsername")	Password = Request.Form("txtPassword")	Fullname = Request.Form("txtFullname")			'Check if username and password are entered	if Username = "" then Response.redirect("login.asp?login=createnamefailed")	if Password = "" then Response.Redirect("login.asp?login=createpassfailed")		'Build connection	set conn = server.CreateObject ("ADODB.Connection")	conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & server.MapPath ("users.mdb")	set rs = server.CreateObject ("ADODB.Recordset")	'Open all records	rs.Open "SELECT * FROM userlist", conn, 3, 3 		'Check if username doesn't already exist	do while not rs.EOF		if rs("username")=Username then			set rs=nothing			set conn=nothing			Response.Redirect("login.asp?login=createnamefailed")		end if		rs.MoveNext	loop			'Add a record	rs.AddNew 	'Put username and password in record	rs("username")=Username	rs("password")=Password	rs("fullname")=Fullname	'Save record	rs.Update 		set rs=nothing	set conn=nothing	Response.Redirect("login.asp?login=creatednew")%>

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...