Why my records are read only?

  • Thread starter Thread starter Al
  • Start date Start date
A

Al

I have an access front end with sql server 2005 back end. when I run the
following code:

Set db = CurrentDb()
Set rst = db.OpenRecordset("tblUserLog",
dbOpenDynaset, dbSeeChanges, dbOptimistic)

With rst
.AddNew
![UserID] = Me![SelectUser]
.Update
End With

The code break on .AddNew and gives me the error message "Cannot update.
Database or Object is read-only"

even though the account I use has the read/write permession and has the
sysadmin role.
any idea?
thanks
 
Does tblUserLog have a primary key defined on it? Unless there's a unique
index on the table, it's going to be read-only when connecting using ODBC.
 
Yes you are right. that fixed it.thnx

Douglas J. Steele said:
Does tblUserLog have a primary key defined on it? Unless there's a unique
index on the table, it's going to be read-only when connecting using ODBC.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Al said:
I have an access front end with sql server 2005 back end. when I run the
following code:

Set db = CurrentDb()
Set rst =
db.OpenRecordset("tblUserLog",
dbOpenDynaset, dbSeeChanges, dbOptimistic)

With rst
.AddNew
![UserID] =
Me![SelectUser]
.Update
End With

The code break on .AddNew and gives me the error message "Cannot update.
Database or Object is read-only"

even though the account I use has the read/write permession and has the
sysadmin role.
any idea?
thanks
 
Back
Top