Error when adding records to a databse.

Results 1 to 6 of 6

Thread: Error when adding records to a databse.

  1. #1
    Join Date
    Dec 1969

    Default Error when adding records to a databse.

    When I try to add a record to my access database I get this error:<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>/a/asp/process.asp, line 32 <BR><BR>the error is when I call the upadate method...<BR>I open the database with adOpenKeyset and adLockOptimistic<BR><BR>I have made sure that the database is not read-only...might this pertain to the databse itself inside access???I hope I made that clear...

  2. #2 Guest

    Default Show us your code!


  3. #3
    Join Date
    Dec 1969

    Default Here is the code.

    &#060;%<BR>Dim Conn<BR>Dim Records<BR><BR>Set Conn = Server.CreateObject("ADODB.Connection")<BR>Conn.Co nnectionString="DRIVER={Microsoft Access Driver (*.mdb)};" & "DBQ=" & Server.MapPath("/a/asp/users.mdb")<BR>Conn.Open<BR><BR>Set Records = Server.CreateObject("ADODB.Recordset")<BR>Records. open "users", Conn, adOpenKeyset, adLockPessimistic, adCmdTable<BR>%&#062;<BR>&#060;%<BR> Records.AddNew<BR> Records("FirstName") = Request.Form("firstname")<BR> Records("LastName") = Request.Form("lastname")<BR> Records("Email") = Request.Form("email")<BR> Records("Username") = Request.Form("username")<BR> Records("Password") = Request.Form("password")<BR> Records.Update<BR>%&#062;

  4. #4
    iyyappan n iyer Guest

    Default try this "select * from users", Conn, 2,2<BR>

  5. #5
    csutton Guest

    Default RE: Error when adding records to a databse.

    I had the same error and was directed to the following article:<BR><BR><BR>Very helpful.<BR><BR>

  6. #6
    Join Date
    Dec 1969

    Default RE: Here is the code.

    Since the DB is in your Server.MapPath, it is contained within the Inetpub folder. It is probably a permissions issue. To test, move the database out of the Inetpub folder. (C:Dev or something). Then check the permissions and make sure the everyone group has at least read/write. Change your connection to point to the new location and test.<BR><BR> You don&#039t usually want to put your DBs inside of the Inetpub folder. When you do, you allow your users to be able to download the .MDB if they can guess the path. You definitely don&#039t want that in a production environment.<BR><BR> - Jeff

Posting Permissions

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