Run-time error 3027: Cannot Update. Database or object is read-only. (1 Viewer)

lespritdelescalier

Registered User.
Local time
Today, 02:54
Joined
Mar 16, 2015
Messages
50
I did a search, and found some results, but none seemed to address the issues that I am having.

I have two database tables, which have identical structure. Each table is hosted in a different physical and virtual location. My application connects to both databases.

Editing table 1 works just fine, but editing table 2 gives me the 3027 error. Note that I can INSERT on both tables without any issue.

The code is simple. The error happens on the Edit command.

Code:
Dim db as Database
Set db = CurrentDb

Dim rsUpdate as Recordset

Set rsUpdate = db.openRecordset("CUSTOMER_ORDER", dbOpenDynaset)
With rsUpdate
   .Edit
'more lines where i assign values to fields

Anyone have any thoughts as to what might be causing this?
 

Ranman256

Well-known member
Local time
Today, 05:54
Joined
Apr 9, 2015
Messages
4,337
you dont always need the .EDIT.
just alter the field. Remove the .edit and see if it works.
 

lespritdelescalier

Registered User.
Local time
Today, 02:54
Joined
Mar 16, 2015
Messages
50
Thanks for your reply - I get the same error, but just on the following line. The code for that line is just assigning a variable to a field, but here it is anyways:

Code:
!STATUS = m_strStatus
 

JHB

Have been here a while
Local time
Today, 11:54
Joined
Jun 17, 2012
Messages
7,732
you dont always need the .EDIT.
just alter the field. Remove the .edit and see if it works.
I total disagree, (ofcause it it is a new record then you don't need the .Edit, but else), so could you post a sample database?
 

gemma-the-husky

Super Moderator
Staff member
Local time
Today, 10:54
Joined
Sep 12, 2006
Messages
15,653
what IS error 3027?

is this the "read-only"?

odd, if you can insert records.
 

Ranman256

Well-known member
Local time
Today, 05:54
Joined
Apr 9, 2015
Messages
4,337
Is lStatus a long var?
What is the mStrStaus value?
 

lespritdelescalier

Registered User.
Local time
Today, 02:54
Joined
Mar 16, 2015
Messages
50
Hey everyone,

Thanks for the responses. Turns out that this was an issue with the table in the database. When the table was created by the DBA (scripted out from the original that was working), the primary keys were not defined. While I defined them in Access when I linked the table, I was still not able to modify any existing records. Adding the primary keys to the table and refreshing the link in Access solved the issue.
 

Data20/20LLC

New member
Local time
Today, 05:54
Joined
Jan 14, 2020
Messages
2
I get this Error 3027 when I try to execute a command button to Export a table as a Text (.txt) file with pipes as delimiters instead of commas (using Export Specifications). I even checked to make sure my destination folder and subfolder where not set to Read Only. I tried looking for syntax to show me how I can designate the resulting, exported table to be read/write. No luck. Any ideas of what may do?

Does this DoCmd require the Tables have a Primary Key? The table I'm working with does not.

Table (tblTimeEXPORT) displayed in a subform Control in the database (I've distorted the view of the EmpID and Names a little):
Sample_tblTimeEXPORT_subformview.png

Specs:
Source table: tblTimeEXPORT
Export Specification (with pipes ("|") as the delimiter: TblTimeEXPORT_Export_Specification
Resulting table: raymondjames_time_01142020_170800.txt (for example)

MY VBA coding:

Private Sub cmdExport_Click()

Dim sNow As String
Dim sPath As String
Dim sFile As String 'MJ: Testing
Dim sXFile As String 'MJ: Testing
Dim sFileExt As String 'MJ: Testing

sNow = Format(Now(), "mmddyyyy_hhmmss")
sPath = "\\itfs1\admin_share$\it management financial statements\#WIP\Michelle_J\PWA Timesheets\Test_Results"

'Define the variable with the text file name.
sFile = "raymondjames_time_"
sFileExt = ".txt"
sXFile = sPath & sFile & sNow & sFileExt

DoCmd.TransferText acExportDelim, "TblTimeEXPORT_Export_Specification", "tblTimeEXPORT", "sXFile", False

End Sub
 

Micron

AWF VIP
Local time
Today, 05:54
Joined
Oct 20, 2018
Messages
3,478
I don't know for sure, but usually it is better to start your own thread rather than "hijack" one, especially if it is almost 3 years old. Your issue may not be related at all, which means it's better to have additional threads that suit the problem and it's circumstances.
 
Last edited:

Users who are viewing this thread

Top Bottom