Read-only Databse!
Hi Guys, just registered to the service.
Been taking a look at some of the Forums, looks very interesting.
I Have been trying to learn ASP over the last month, using the WROX books, (Begining ASP 3.0). going quite well at the moment.
However while doing one of the exercises in the book, Chapter 15, i have come across a problem with my database.
The error reads:
The page cannot be displayed
There is a problem with the page you are trying to reach and it cannot be displayed.
--------------------------------------------------------------------------------
Please try the following:
Click the Refresh button, or try again later.
Open the localhost:81 home page, and then look for links to the information you want.
HTTP 500.100 - Internal Server Error - ASP error
Internet Information Services
--------------------------------------------------------------------------------
Technical Information (for support personnel)
Error Type:
Microsoft JET Database Engine (0x80040E09)
Cannot update. Database or object is read-only.
/BegASP/AddUser.asp, line 13
Browser Type:
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.1.4322)
Page:
POST 119 bytes to /BegASP/AddUser.asp
POST Data:
email=h&GivenName=h&FamilyName=h&Address1=h&Addres s2=&City=h&State=h&PostalCode=h&Country=h&Password =h&VerifyPassword=h
Time:
08 December 2003, 12:32:55
More information:
Microsoft Support
---------------------------------------------------------------------My code is :
<%
Dim rsUsers
Set rsUsers = Server.CreateObject("ADODB.Recordset")
rsUsers.Open "Person", objConn, adOpenForwardOnly, adLockOptimistic, adCmdTable
If Session("PersonID") <> "" Then ' currently logged-on user
rsUsers.Filter = "PersonID = '" & Session("PersonID") & "'"
Else ' New session
rsUsers.Filter = "EMailAddress = '" & Request.Form("email") & "'" & _
"AND Password = '" & Request.Form("password") & "'"
If rsUsers.EOF Then ' User not found
rsUsers.AddNew ' ...so add a new record
' Else
' Email address and password matched with DB records -
' In this case we'll allow this to update user's personal details
End If
End If
' write personal details to record
rsUsers("EMailAddress") = Request.Form("email")
rsUsers("Password") = Request.Form("password")
rsUsers("FamilyName") = Request.Form("FamilyName")
rsUsers("GivenName") = Request.Form("GivenName")
rsUsers("StreetAddress1") = Request.Form("Address1")
rsUsers("StreetAddress2") = Request.Form("Address2")
rsUsers("City") = Request.Form("City")
rsUsers("State") = Request.Form("State")
rsUsers("PostalCode") = Request.Form("PostalCode")
rsUsers("Country") = Request.Form("Country")
rsUsers("Active") = True
rsUsers("LastLogin") = Now
rsUsers.Update ' update the database
Dim strName, strValue ' create session variables
For each strField in rsUsers.Fields
strName = strField.Name
strValue = strField.value
Session(strName) = strValue
Next
Session("blnValidUser") = True ' declare that current user is validated
Response.Redirect "MenuForRegisteredUsers.asp"
%>
---------------------------------------------------------------------
What shall i do?
How do i change the database, which i downloaded form the WROX website, from read-only to allowing me to make changes to it.
your help would be appreciated
thanks
|