Jump to content

Message "Read Only"


jebat886

Recommended Posts

Hi everybody.. i need some help this is the 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")%>if i tried to register new user into database the message "READ ONLY" will come out and it's indicate at line 29 and it's the one that i wrote with bold in the code above..I can't figure out whats wrong with that..could somebody help me

Link to comment
Share on other sites

It sounds like your database file is read-only. Find your MDB file and change it to allow write access. The error is probably on the rs.AddNew line, it wouldn't give an error on a line with a comment.
Hi justsomeguy..What do you mean by change it to allow write access..it's that by changing the properties i mean the checkbox for read-only? If that what you mean i've already changed it but it's still the same message the browser will print out when i tried to register new user into my database
Link to comment
Share on other sites

If the only thing you see on the screen is the words "READ ONLY", then that's a little bit vague. I assume it's talking about the MDB file being read-only. The problem might also be that you need to use a username and password to connect to the database. I don't work with Access databases so I'm not real sure, I'm just going on the assumption that the error message says "READ ONLY". The only thing you need to write to is the database file. So either the database file is marked as read-only, or you need to provide a password to use it.

Link to comment
Share on other sites

If the only thing you see on the screen is the words "READ ONLY", then that's a little bit vague. I assume it's talking about the MDB file being read-only. The problem might also be that you need to use a username and password to connect to the database. I don't work with Access databases so I'm not real sure, I'm just going on the assumption that the error message says "READ ONLY". The only thing you need to write to is the database file. So either the database file is marked as read-only, or you need to provide a password to use it.
Thank's justsomeguy i really appericiate that :) I've already fixed the problem
Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...