Problems updating a DB

Results 1 to 2 of 2

Thread: Problems updating a DB

  1. #1
    Join Date
    Dec 1969

    Default Problems updating a DB

    &nbsp;<BR>Im trying to update a field and no matter what i do i get a<BR><BR>"Microsoft OLE DB Provider for ODBC Drivers error &#039 80004005&#039 <BR><BR>[Microsoft][ODBC Microsoft Access Driver] Cannot update. Database or object is read-only. "<BR><BR>I have ALREADY set write access to the DB directoryfile on the web server. So that isnt the problem<BR><BR>Here&#039s the code<BR><BR>Dim NewsDb, News_ID<BR><BR>Set NewsDB = server.CreateObject("adodb.recordset")<BR>NewsDB.O pen "News", "DB",adOpenKeyset,adLockOptimistic<BR>News_ID = CLng(Request.QueryString("id"))<BR><BR>Dim N_Time, N_Date, N_User, N_Headline, N_News, N_Desc, N_Link, N_Latest<BR><BR> &#039 I know all this works, these forms below are passed<BR> &#039 from the previous page<BR><BR>N_Time = Request.Form ("Time")<BR>N_Date = Request.Form ("Date")<BR>N_User = Request.Form ("User")<BR>N_Headline = Request.Form ("Headline")<BR>N_News = Request.Form ("News")<BR>N_Desc = Request.Form ("Desc")<BR>N_Link = Request.Form ("Link")<BR>N_Latest = Request.Form ("Latest")<BR><BR> &#039 Moves to the correct record in the DB<BR><BR>NewsDB.MoveFirst<BR>DO UNTIL NewsDB.Fields("ID") = News_ID<BR>NewsDB.MoveNext<BR>LOOP<BR><BR>NewsDB(" Time") = N_Time<BR>NewsDB("Date") = N_Date<BR>NewsDB("User") = N_User<BR>NewsDB("Headline") = N_Headline<BR>NewsDB("News") = N_News<BR>NewsDB("Desc") = N_Desc<BR>NewsDB("Link") = N_Link<BR>NewsDB("Latest") = N_Latest<BR><BR> &#039 I know upto here works, cos i can, for EG<BR> &#039 go response.write NewsDB("User") and it will give me the<BR> &#039 updated value, but when i try and write the changes,<BR> &#039 i get the above error<BR><BR><BR>NewsDB.Update<BR>%&#062;<BR><BR>S OMEONE PLEASE HELP ME.. I&#039ve been banging my head agaisnt the wall for the better part of a week trying to solve this.<BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: Problems updating a DB

    well, you have an optimistic cursor, so it&#039s not that - it&#039s an unusual error. maybe the actual file is read only, rather than the directory.<BR><BR>which line is the error thrown on?<BR><BR>jason

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts