jaffar2000
Registered User.
- Local time
- Yesterday, 22:05
- Joined
- Apr 15, 2012
- Messages
- 28
Hi,
My code is working just fine on my computer and I can update the access from my excel.
When trying to do the same from one of my user's computer, I get this error message:
"Run-time error '3251': Current Recordset does not support updating. This may be a limitation of the provider, or of the selected locktype."
Here is the relevant part of the code:
**********************************************
Dim cn As ADODB.Connection
Dim rs As ADODB.Recordset
Set cn = New ADODB.Connection
cn.ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=\\IP\referantim\System Change Requests\Requests_Management_File.accdb;Persist Security Info=False;"
cn.Open
Set rs = New ADODB.Recordset
rs.Open "Requests", cn, adOpenKeyset, adLockOptimistic, adCmdTable
With rs
.AddNew
.Fields("request_date") = Sheets("form").Range("H4")
.Fields("requested_by") = Sheets("form").Range("B4")
.Fields("department") = Sheets("form").Range("B8")
.Update
End With
rs.Close
Set rs = Nothing
cn.Close
Set cn = Nothing
******************************************
We both use access2007 and excel 2010
I use excel 2010 and my user excel 2007.
I have win7 and my user winXP
Any ideas?
My code is working just fine on my computer and I can update the access from my excel.
When trying to do the same from one of my user's computer, I get this error message:
"Run-time error '3251': Current Recordset does not support updating. This may be a limitation of the provider, or of the selected locktype."
Here is the relevant part of the code:
**********************************************
Dim cn As ADODB.Connection
Dim rs As ADODB.Recordset
Set cn = New ADODB.Connection
cn.ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=\\IP\referantim\System Change Requests\Requests_Management_File.accdb;Persist Security Info=False;"
cn.Open
Set rs = New ADODB.Recordset
rs.Open "Requests", cn, adOpenKeyset, adLockOptimistic, adCmdTable
With rs
.AddNew
.Fields("request_date") = Sheets("form").Range("H4")
.Fields("requested_by") = Sheets("form").Range("B4")
.Fields("department") = Sheets("form").Range("B8")
.Update
End With
rs.Close
Set rs = Nothing
cn.Close
Set cn = Nothing
******************************************
We both use access2007 and excel 2010
I use excel 2010 and my user excel 2007.
I have win7 and my user winXP
Any ideas?