Error 3027 Cannot Update. Database or object is read-only (1 Viewer)

shenty

Registered User.
Local time
Today, 19:00
Joined
Jun 8, 2007
Messages
119
I have a very strange problem that has appeared on 3 databases. Error 3027. Cannot update. Database or object is read-only.

I have checked & changed nothing to do with folder persmissions etc. The 3 databases are independant but similar.

All 3 use linked data tables.

The error happens in the VBA code rSt.AddNew.

I have created a new blank database & imported the necessary forms, tables & queries so there are no linked tables and the error is still there.

But all these databases used to work !!!!

Does anyone have the slightest idea where these errors have suddenly appeared from ?

Help would be much appreciated.

P.S. My Stripped down DB is attached. Clicking the "Add Record to cows history ---->" causes it.
 

Attachments

  • error 3027 fixing.zip
    141.1 KB · Views: 907

jzwp22

Access Hobbyist
Local time
Today, 15:00
Joined
Mar 15, 2008
Messages
2,629
The query for the recordset appears to be un-updateable. Since all of the fields you want to add to are in the tblAIRegister, I would use just the table rather than the query.

Code:
If MsgBox("Add to history ?", vbYesNo, "Add Record") = vbYes Then
        Set rSt = dbs.OpenRecordset("tblAIRegister")
        rSt.AddNew
        rSt!AIDate = Me.AIBullingDate
        rSt!TAG = Me.txtTAG
        rSt!AIBull = Me.txtBullName
        rSt!AIorBull = RecordType
        rSt!AIBullBreed = Me.Combo26
        rSt!Action = Action
        rSt!Notes = Me.txtNotes
        rSt.Update
End If
 

shenty

Registered User.
Local time
Today, 19:00
Joined
Jun 8, 2007
Messages
119
you hit the nail on the head there mate......coincidently i figured that out about an hour ago before realising you posted.

i noticed the query was unupdateable because of the animal register table and linked field in the qryAIRegister.

but why would that make it unupdateable ?

i am also racking my brains as to when i changed this and i think i remember. now i just need to make sure this doesn't affect anything else !

oh the joys of programming :)

many thanks for taking the time to look.
 

jzwp22

Access Hobbyist
Local time
Today, 15:00
Joined
Mar 15, 2008
Messages
2,629
I'm not sure why it would become un-updateable, but it is not the first time I have run into it.

I'm glad you got it worked out. Good luck on your project.
 

WIS

Registered User.
Local time
Tomorrow, 06:00
Joined
Jan 22, 2005
Messages
170
i noticed the query was unupdateable because of the animal register table and linked field in the qryAIRegister.

but why would that make it unupdateable ?
If any qry has more than one join fld index set to Duplictes Yes (Allowed) then the qry is not updateable.

To check, run the qry and if not updateable, the * on the Navigation Button is grayed out.
 

mjdemaris

Working on it...
Local time
Today, 12:00
Joined
Jul 9, 2015
Messages
424
I know this is a long dead topic, but, while searching for an answer to my problem with Error 3027, I found this thread.

In my situation, I changed the query from one table to another, but in design view I forgot to remove the first table on the table view. Even though it had no fields involved in the query, just it being there made the SQL get squirly.

Mike
 

jzwp22

Access Hobbyist
Local time
Today, 15:00
Joined
Mar 15, 2008
Messages
2,629
If you left a table in the query and there was no join between that table and another table in the query, the query will return a Cartesian product of the two tables. So if you had 1000 records in 1 table and 500 records in the other, the query would return about 500,000 records (1000 x 500).
 

mjdemaris

Working on it...
Local time
Today, 12:00
Joined
Jul 9, 2015
Messages
424
In my case, no fields were selected in the second table, so it was just sitting there. That's what gave me that error.

But, I did not know that, jz. Thanks!
 

jzwp22

Access Hobbyist
Local time
Today, 15:00
Joined
Mar 15, 2008
Messages
2,629
Typically a query that returns a Cartesian Product will not be updateable. Are you trying to run an action query (update, append etc.)?

Can you post the SQL text of the query?
 

Users who are viewing this thread

Top Bottom