can't update my database

Results 1 to 4 of 4

Thread: can't update my database

  1. #1
    Tony Guest

    Default can't update my database

    Hi all,<BR><BR>I am stuck with this problem I&#039ve been having for months, I don&#039t know what is wrong at all. I keep getting the error message:<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>/jobs/clientDB.asp, line 124 <BR><BR>My portion of code looks like this<BR><BR>objConn1.Open "DBQ="+Server.MapPath("/jobs/database/service.mdb")+";Driver={Microsoft Access Driver (*.mdb)};DriverId=25;FIL=MS Access;"<BR><BR> "SELECT * FROM Clients", objConn1, adOpenDynamic, adLockOptimistic<BR><BR><BR>rsClients.AddNew<BR> rsClients("FirstName") = sFirstName<BR> rsClients("LastName") = sLastName<BR> rsClients("Address") = sAddress<BR> rsClients("City") = sCity<BR> rsClients("StateOrProvince") = sStateOrProvince<BR> rsClients("PostalCode") = sPostCode<BR><BR>rsClients.Update<BR>rsClients.Mov eFirst<BR><BR>rsClients.Close<BR>objConn1.Close<BR >set rsClients = nothing<BR>set objConn1 = nothing<BR><BR>Any suggestions would be greatly appreciated!<BR>

  2. #2
    JP Norair Guest

    Default RE: can' update my database

    First off, never use adOpenDynamic. You can do updates with adOpenForwardOnly. adOpenKeyset and adOpenDynamic really have no use on the web.<BR><BR>I&#039ve have problems doing updates sometimes, often because when doing so through ADO it get finnicky with SQL. So, for your line try:<BR>rsClients.Open "clients", objConn1, adOpenForwardOnly, adLockPessimistic, adCmdTable<BR><BR>For some reason, this method has a nasty habit of working. If you still get errors, the problem lies in your DB or DB connection string.<BR><BR>Good Luck

  3. #3
    Tony Guest

    Default RE: can' update my database

    Thanks for that JP Norair,<BR><BR>but it must be my database, i&#039ve recently changed from Access 97 to Access 2000 and that&#039s when the problems have occurred.<BR>Thanks for your time anyway :)<BR><BR>-Tony

  4. #4
    Join Date
    Dec 1969

    Default RE: can' update my database

    are you sure your database has full read write permissions??

Posting Permissions

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