Read-only Error

DeeDee77

Registered User.
Local time
Today, 20:27
Joined
Jan 24, 2002
Messages
21
I have a query that I am calling through a recordset statement. When it hits the .addnew line an error message comes up that says "Cannot update. Object or database is read-only". I have checked every possible thing that I can think of that could be marked read-only, and nothing is. Does anyone know how to fix this? Thanks!
 
Open the query from the database window and see if you can add records. If not, you'll need to figure out why the query is not updateable. For example, are you using any aggregate functions? Do you have update permission to all the tables involved. If you are joining more than two tables, do they have a hierarchial relationship?
 
How do I check for aggregate functions or update permission?
 
To check for aggregate functions, if it is a stored query, open it in design view. Look at what is stored in the top row of each non-blank column. If any column contains Count(), Sum(), Max(), Min(), Avg() {where some field name is inside the parentheses} you have an aggregate.

If the query grid has a row titled "Total" then you have a Totals query, which is implicitly an aggregate even if none of the named functions happens to be present.

If the query is created "on the fly" and is an argument of the recordset, it might not be updateable either.

If the query is a stored query, open its property sheet to see if it is a Snapshot query. This is not an updateable query type. If it is a dynaset-type, table-type, or dynamic-type query, you should be able to update that unless there is an aggregate in the way.
 

Users who are viewing this thread

Back
Top Bottom