By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,743 Members | 1,266 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,743 IT Pros & Developers. It's quick & easy.

Why am I getting the error in Access 2010 "Current Recordset does not support updatin

P: 4
I am using Access 2010 and I am getting this error:

"Current Recordset does not support updating. There may be a limitation of the provider, or of the selected locktype."

Expand|Select|Wrap|Line Numbers
  1. Dim SQLstr as String
  2. Dim R as ADODB.Recordset
  3. Set R = New ADODB.Recordset
  4.  
  5. SQLstr = "SELECT * FROM TABLE1;"
  6. R.OPEN SQLstr, CurrentProject.Connection, _
  7. adOpenDynamic, adLockReadOnly
  8.  
  9. R.AddNew 'error here
I have tried many combinations of locktypes and tried to look at similar questions asked, but I have no idea why this error is happening. Thanks in advance for any input!
Jun 14 '14 #1

✓ answered by jimatqsi

firebird,
Welcome to Bytes.com. Weekends arent't the busiest time here, but there's usually at least one guy on deck. I guess that's me, today, even though I don't use ADO much.

If you read you own code you'll see the answer is obvious. You're opening the table in Read Only mode - read only means not in write mode.

Take a look at this: http://www.w3schools.com/ado/prop_rs_locktype.asp

Note the LockTypeEnum enumerator spells out the different values for that parameter. You probably want adLockOptimistic.

Jim

Share this Question
Share on Google+
2 Replies


Expert 100+
P: 1,240
firebird,
Welcome to Bytes.com. Weekends arent't the busiest time here, but there's usually at least one guy on deck. I guess that's me, today, even though I don't use ADO much.

If you read you own code you'll see the answer is obvious. You're opening the table in Read Only mode - read only means not in write mode.

Take a look at this: http://www.w3schools.com/ado/prop_rs_locktype.asp

Note the LockTypeEnum enumerator spells out the different values for that parameter. You probably want adLockOptimistic.

Jim
Jun 14 '14 #2

P: 4
Ha! Whoops. I thought I'd copied over directly from another module that worked so I was falsely confident that wasn't the problem.

Of course I see it now and it works. Thanks for answering my question, I'm really new to this VBA stuff.
Jun 14 '14 #3

Post your reply

Sign in to post your reply or Sign up for a free account.