473,503 Members | 12,425 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Current Recordset does not support updating

88 New Member
Hi,

I get the following error on the last line:

Run-time error '3251':

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

Expand|Select|Wrap|Line Numbers
  1.     ' Open database connection
  2.     Set adoConn = CreateObject("ADODB.Connection")
  3.     adoConn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source = " & strArchivePath & "mailarchive.mdb" & ";User ID=Admin;Password=;"
  4.     adoConn.Open
  5.  
  6.     ' Open recordset
  7.     Set adoRecSet = New ADODB.Recordset
  8.     adoRecSet.Open "SELECT * FROM tblEmail ORDER BY ISS ASC", adoConn, adOpenKeyset, adLockOptimistic
  9.  
  10. adoRecSet.MoveLast
  11. adoRecSet.AddNew
I did some searches in this forum, but setting the locktype to adLockOptimistic apparently does not help... What do I do wrong with this one?
Sep 3 '07 #1
9 16182
QVeen72
1,445 Recognized Expert Top Contributor
Hi,

Change this :


Expand|Select|Wrap|Line Numbers
  1. adoRecSet.Open "SELECT * FROM tblEmail ORDER BY ISS ASC", adoConn, adOpenDynamic, adLockOptimistic
  2.  
Change KeySet to Dynamic..

REgards
Veena
Sep 3 '07 #2
BlackMustard
88 New Member
Hi,

Change this :


Expand|Select|Wrap|Line Numbers
  1. adoRecSet.Open "SELECT * FROM tblEmail ORDER BY ISS ASC", adoConn, adOpenDynamic, adLockOptimistic
  2.  
Change KeySet to Dynamic..

REgards
Veena
I did, but still get the same error... :S
Sep 3 '07 #3
QVeen72
1,445 Recognized Expert Top Contributor
Hi,

I get the following error on the last line:

Run-time error '3251':

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

Expand|Select|Wrap|Line Numbers
  1.     ' Open database connection
  2.     Set adoConn = CreateObject("ADODB.Connection")
  3.     adoConn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source = " & strArchivePath & "mailarchive.mdb" & ";User ID=Admin;Password=;"
  4.     adoConn.Open
  5.  
  6.     ' Open recordset
  7.     Set adoRecSet = New ADODB.Recordset
  8.     adoRecSet.Open "SELECT * FROM tblEmail ORDER BY ISS ASC", adoConn, adOpenKeyset, adLockOptimistic
  9.  
  10. adoRecSet.MoveLast
  11. adoRecSet.AddNew
I did some searches in this forum, but setting the locktype to adLockOptimistic apparently does not help... What do I do wrong with this one?
Hi,

Why are u "Late Binding" the Object by creating...?

Directly Declare :
Dim adoConn As New ADODB.Connection
Dim adoRecSet As New ADODB.RecordSet

And Check "strArchivePath" Should have last Char ="\" some thing like :
C:\MyFolder\Data\

Regards
Veena
Sep 3 '07 #4
QVeen72
1,445 Recognized Expert Top Contributor
Hi,

What Version of ADO Objects u have Included in ur proj..?

It Should be :
"Microsoft ActiveX Data Objects 2.0 Library"

or Higher..

REgards
Veena
Sep 3 '07 #5
BlackMustard
88 New Member
I have included a library called "Microsoft ActiveX Data Objects 2.7 Library", and I changed the declarations in (General) to the following:

Expand|Select|Wrap|Line Numbers
  1. Dim adoConn As New ADODB.Connection
  2. Dim adoRecSet As New ADODB.RecordSet
In my code, i then removed the "Set" commands, leaving the code at

Expand|Select|Wrap|Line Numbers
  1.     ' Open database connection
  2.     adoConn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source = " & strArchivePath & "mailarchive.mdb" & ";User ID=Admin;Password=;"
  3.     adoConn.Open
  4.  
  5.     ' Open recordset
  6.     adoRecSet.Open "SELECT * FROM tblEmail ORDER BY ISS ASC", adoConn, adOpenDynamic, adLockOptimistic
  7.  
  8.     ' Add record
  9.     adoRecSet.MoveLast
  10.     adoRecSet.AddNew
I still get the same error...

EDIT:
strArchivePath is previously set directly in code, and does end with a "\". I use a variable just to make it easier to change if i want to use this sub somewhere else.
Sep 3 '07 #6
BlackMustard
88 New Member
I found the error - I was using the same recordset in another function, so the adoRecSet variable didn't contain what i thought it did. Problem solved by using a separate recordset.
Sep 4 '07 #7
QVeen72
1,445 Recognized Expert Top Contributor
Hi,

Good u solved, if that was the Case, then u can overcome that problem, by Setting the Recset = Nothing before opening it..:

Set RS =Nothing
and then Open :
RS.Open strSQL, AConn

REgards
Veena
Sep 4 '07 #8
BlackMustard
88 New Member
Hi,

Good u solved, if that was the Case, then u can overcome that problem, by Setting the Recset = Nothing before opening it..:

Set RS =Nothing
and then Open :
RS.Open strSQL, AConn

REgards
Veena
Well, now i've already emailed the macro out to the entire department =) But this is worth remembering for next time... Does it optimize the prestanda compared to using several different recordsets?
Sep 4 '07 #9
lenard2500
1 New Member
Download this instructions
hope it will help you
Download Link
Jun 19 '09 #10

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

Similar topics

8
12066
by: Zlatko Matić | last post by:
There is a form (single form) and a combobox. I want that current record of the form is adjusted according to selected value in the combobox. Cuurrent record should be the same as the value in the...
36
4413
by: kjvt | last post by:
Based on a prior posting, I've written a function to convert a recordset to a dataview. The first call to the function for a given recordset works perfectly, but the second call always returns a...
2
3028
by: barret bonden | last post by:
(closest newsgroup I could find) Error Type: ADODB.Recordset (0x800A0CB3) Current Recordset does not support updating. This may be a limitation of the provider, or of the selected locktype....
5
3712
by: Hexman | last post by:
I've come up with an error which the solution eludes me. I get the error: >An unhandled exception of type 'System.Runtime.InteropServices.COMException' occurred in HRTest.exe > >Additional...
9
24282
by: Johnfli | last post by:
ADODB.Recordset error '800a0cb3' Current Recordset does not support bookmarks. This may be a limitation of the provider or of the selected cursortype. I am moving my webserver from NT4 using SQL...
3
3434
by: melnhed | last post by:
---Report the current filtered records from a Form--- Hello All, I've seen this topic discussed before, but the solution described then doesn't work in my particular case. My Config: ...
8
7473
by: jamesnkk | last post by:
I got this Run-time error 3251 Current Recrdset does not support updating. This may be limation of the provider, or of the selected locktype. Dim red1 As New ADODB.Recordset Dim strmess As...
7
5971
by: michal | last post by:
hi guys, i am using postgres 8.2 and try to add some records to a table with ADODO ... unfortunately i end up with an error when calling the addNew() method. it says that the recordset does not...
0
8959
ADezii
by: ADezii | last post by:
When you create an ADO Recordset, you should have some idea as to what functionality the Recordset does/does not provide. Some critical questions may, and should, be: Can I add New Records to the...
0
7212
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7098
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7296
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7364
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7470
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5604
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4696
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3186
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3174
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.