Results 1 to 3 of 3
  1. #1
    Namibia is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    May 2012
    Posts
    1

    Unhappy Cannot update. Database or object is read-only ERROR

    I want to write an Access 2010 query which should do the following:

    • Loop through Table 'Schools', with just one field (SchoolName).
    • Use each value in the first table to select records from Table 'ChildData', with several fields about individual children, including which school they attend (SchoolName).
    • For each school, export the data for its attending children into a separate Excel workbook (.xlsx) that contain the name of the school.


    In my search I found the following code:


    SELECT ChildData.* INTO [Excel 8.0;HDR=YES;IMEX=2;DATABASE=C:\Example.xls].[MyWorksheet]
    FROM ChildData INNER JOIN Schools ON ChildData.SchoolName = Schools.SchoolName;

    Taking in consideration that by Access knowledge is nearly non-existing (can just do the basics) I tried to run this query and received the following error and have no idea how to resolve it.

    Cannot update. Database or object is read-only

    I did do all the steps found on article - http://support.microsoft.com/default...;en-US;2581301
    Is there anybody that could be so kind as to steer me in the right direction?

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    I tested and a table exports fine but query with table joins generates the read-only error. Could try the TransferDatasheet method. See discussion in http://forums.aspfree.com/microsoft-...el-413629.html

    Why are you doing a join of tables then not exporting data from the second table? If the school name is in ChildData then the Schools table is not needed.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    dreday's Avatar
    dreday is offline Advanced Beginner
    Windows XP Access 2010 32bit
    Join Date
    Aug 2011
    Posts
    58
    Little late to the party on this one, but you could always use a subquery. Something like:

    Select ChildData.* INTO [this excel deal] FROM ChildData WHERE (ChildData.School In (Select SchoolName from schools));

    Didn't test but it takes out the join so maybe you'll have better luck exporting

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

Similar Threads

  1. Can Not Update. Object is Read Only
    By mrfixit1170 in forum Programming
    Replies: 3
    Last Post: 01-03-2012, 03:35 PM
  2. Replies: 6
    Last Post: 09-28-2011, 09:20 PM
  3. Allow Read or Update dep on record
    By AndreT in forum Forms
    Replies: 2
    Last Post: 07-31-2011, 09:46 PM
  4. Runtime Error '3027': Database or object is read only
    By 4x4Masters in forum Programming
    Replies: 4
    Last Post: 06-08-2010, 08:02 PM
  5. Replies: 1
    Last Post: 12-09-2005, 09:16 PM

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