Why my records are read only?

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
 
D

Douglas J. Steele

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.
 
A

Al

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top