473,778 Members | 1,953 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 adLockOptimisti c apparently does not help... What do I do wrong with this one?
Sep 3 '07 #1
9 16243
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 adLockOptimisti c 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.Connectio n
Dim adoRecSet As New ADODB.RecordSet

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

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
12106
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 combobox. What is the solution? Thank you in advance.
36
4483
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 dataview with a count = 0. Can someone explain why and how I might work around this problem? Here is the code for my function: Public Shared Function GetViewFromRS(ByVal pRS As ADODB.Recordset) _ As DataView
2
3048
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. /asp_data3_add.asp, line 30 <% 'Dimension variables Dim adoCon 'Holds the Database Connection Object
5
3750
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 information: Current Recordset does not support updating. This may be a limitation of the provider, or of the selected locktype. It occurs when I attempt to add a new record. I've stripped out much of the code, leaving the pertinent (I hope) info. ...
9
24317
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 to win2003 using SQL 2003 I get the above error when my asp page does teh line: Rs.absolutepage = intCurrentPage I tested teh value of intCurrent page and teh value is 1.
3
3463
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: Access 2002 front-end using SQL Server 2000 (MSDE actually) via ADP/ADE Access Data Project.
8
7507
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 String Set cnp = CurrentProject.Connection strmess = "SELECT * from tblinvoicelines WHERE invoice=" & newInvo
7
5991
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 support updating... i do open the connection the following set RS = server.createObject("scripting.dictionary") RS.open "usr", cn, 1, 3, 2
0
9006
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 Recordset? Does the Recordset support Bookmarks? Can we use the Find and/or Seek Methods with this Recordset? Does the Recordset support the use of Indexes? Will the Absoluteposition property be able to be used on this Recordset? etc....
0
9629
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9465
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10296
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9923
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8954
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6723
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5370
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3627
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2863
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.