Results 1 to 5 of 5
  1. #1
    jscriptor09 is offline Advanced Beginner
    Windows XP Access 2010 32bit
    Join Date
    Jul 2011
    Posts
    60

    db.OpenRecordset error

    Hi folks

    I am trying to open a record to edit/change a field value



    db.OpenRecordset(strSQL)
    rs.edit
    this would give me and error that table is read only.

    I don't seems to find any this on web to help. Tried this
    db.OpenRecordset(strSQL, , , adLockOptimistic)

    but I get error in parameter value

    Any help would be appreciated

    Mike

  2. #2
    aytee111 is offline Competent At Times
    Windows 7 32bit Access 2010 32bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    Set rs = CurrentDb.OpenRecordset(strSQL)

  3. #3
    jscriptor09 is offline Advanced Beginner
    Windows XP Access 2010 32bit
    Join Date
    Jul 2011
    Posts
    60
    Hi Aytee111

    I actually have same thing as you have
    Set db = CurrentDb
    Set rs = db.OpenRecordset(strSQL)
    rs.MoveLast
    Do While Not rs.EOF
    rs.AddNew <<<<<<<< table is a read only

    the strSQL is "SELECT aTable.* FROM aTable;

    The table is a link'ed table (Excel table linked to the DB). I suspect this might be the cause of the problem ; but can't find a way to open the table for writing in access.

    Thanks for the help

  4. #4
    aytee111 is offline Competent At Times
    Windows 7 32bit Access 2010 32bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    If you run that query in the query window do you get the same error? If so, then no code is ever going to work!

  5. #5
    boblarson is offline --------
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2011
    Posts
    1,272
    Linked Excel files can NOT be updated from Access. Microsoft lost a lawsuit many years ago around the technology to do that and, since then, the ability to update Excel workbooks directly as linked tables does not exist.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 8
    Last Post: 12-21-2011, 12:50 PM
  2. OpenRecordset multiple criteria
    By bbrazeau in forum Queries
    Replies: 10
    Last Post: 11-03-2011, 10:01 AM
  3. Replies: 7
    Last Post: 08-17-2011, 01:49 PM
  4. DLookup in strSQL for OpenRecordset
    By szucker1 in forum Programming
    Replies: 2
    Last Post: 07-30-2011, 06:00 PM
  5. OpenRecordset vs. Query
    By crispy-bacon in forum Programming
    Replies: 7
    Last Post: 07-04-2011, 09:52 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums