Wrox Home  
Search P2P Archive for: Go

  Return to Index  

access_asp thread: Get my DB to UPDATE(write) again - already reads the DB data


Message #1 by "Graham Abrey" <design@t...> on Thu, 10 Jan 2002 01:05:41
Hello all,



Win XP

Access 2000

IIS 5



I have been trying to make my Access DB work again. I have had my website 

working fine in the UK but have then copied it and re-loaded it here in 

New Zealand onto another computer.



The problem is that I have managed to get it to read from the Db but when 

it need to update or create new data it does not like it.



The error that I get from IE6 is :-

-------------------------------



Error Type:

Microsoft JET Database Engine (0x80040E09)

Cannot update. Database or object is read-only.

/register/addclient.asp, line 221





Browser Type:

Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1) 



Page:

POST 472 bytes to /register/addclient.asp



POST Data:

FreelancerEmployer=1&Updated=0&Title=Dr&FirstName=Michelle

---------------------------------------





The page that I think is causing the problem is shown below (portion of 

the whole script):-



----------------------------------------------

  Dim rsUsers

  Set rsUsers = Server.CreateObject("ADODB.Recordset")

  rsUsers.Open "Person", objConn, adOpenForwardOnly, adLockOptimistic, 

adCmdTable                     ' IS THIS WHERE IT IS GOING WRONG?????



  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 -- THIS IS LINE 221

'   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

if ChkPersonType = 1 then

  rsUsers("Freelancer") = True

End If

if ChkPersonType = 0 then

  rsUsers("Employer") = True

End If



  rsUsers("Title") = Request.Form("Title")

  rsUsers("FirstName") = Request.Form("FirstName")

  rsUsers("LastName") = Request.Form("LastName")

  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.Update                        ' update the database



-------------------------------



It there a PROBLEM in the script because it worked when I was in the UK 

or could I have overlooked something regarding the setup of the Virtual 

server (my computer)? If I have how do I sort it out because I have left 

my books in the UK.



Thanks in advance for your help,



Regards,

Graham
Message #2 by "Mike Frane" <mfrane@t...> on Sat, 12 Jan 2002 03:15:42
If you copied the files from you old computer, say to a CD, and then 

copied them onto your new machine, the files are "Read Only". Right click 

on the file and choose properties, if Read Only is checked, that's most 

likely your problem.

Regards

Mike
Message #3 by "Graham Abrey" <design@t...> on Tue, 15 Jan 2002 09:12:54
Hi Mike,

I thought that was teh problem to but unfortunatelly its not that easy. 

The scripts seem to read from the DB OK but when ever I write to it, it 

fails with the error messgae



Error Type:

Microsoft JET Database Engine (0x80040E09)

Cannot update. Database or object is read-only.

/efreelancer/jobs/checkcreatejob.asp, line 219



I was wondering whether somethin is wrong with the setup of the server? I 

can figure it out where. Everything looks in place. Any other ideas?



Regards,

Graham



> If you copied the files from you old computer, say to a CD, and then 

> copied them onto your new machine, the files are "Read Only". Right 

click 

> on the file and choose properties, if Read Only is checked, that's most 

> likely your problem.

> Regards

> Mike

  Return to Index