473,657 Members | 2,266 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Current Recrdset does not support updating

134 New Member
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
Set red1 = cnp.Execute(str mess)

If Not red1.EOF Then
red1.MoveFirst
Do While Not red1.EOF
If red1!Invoice = newInvo Then
red1.Fields("am ount") = Round(red1!Qty_ Order * red1!Sell_price , 2)
red1.Update

End If
red1.MoveNext
Loop

End If

How can I resolve this, why MS Access does allow this simple updating ?
Dec 23 '06 #1
8 7489
sashi
1,754 Recognized Expert Top Contributor
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
Set red1 = cnp.Execute(str mess)

If Not red1.EOF Then
red1.MoveFirst
Do While Not red1.EOF
If red1!Invoice = newInvo Then
red1.Fields("am ount") = Round(red1!Qty_ Order * red1!Sell_price , 2)
red1.Update

End If
red1.MoveNext
Loop

End If

How can I resolve this, why MS Access does allow this simple updating ?
Hi there,

Kindly refer to below modified code segment, hope it helps. Good luck & Take care.

Expand|Select|Wrap|Line Numbers
  1.   strmess = ""
  2.   strmess = "SELECT * from tblinvoicelines  WHERE invoice=" & newInvo
  3.   red1.Open strmess, CurrentProject.Connection, _
  4.             adOpenKeyset, adLockOptimistic
  5.  
Dec 23 '06 #2
ADezii
8,834 Recognized Expert Expert
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
Set red1 = cnp.Execute(str mess)

If Not red1.EOF Then
red1.MoveFirst
Do While Not red1.EOF
If red1!Invoice = newInvo Then
red1.Fields("am ount") = Round(red1!Qty_ Order * red1!Sell_price , 2)
red1.Update

End If
red1.MoveNext
Loop

End If

How can I resolve this, why MS Access does allow this simple updating ?
If I am not mistaken, and unless otherwise specified, isn't the Default ADO
Recordset Read Only..
Dec 23 '06 #3
sashi
1,754 Recognized Expert Top Contributor
If I am not mistaken, and unless otherwise specified, isn't the Default ADO
Recordset Read Only..
Hi there,

Yes, the default locktype is set to adLockReadOnly. This property is set to read/write on a closed recordset and read-only on an open recordset. Take care.
Dec 24 '06 #4
jamesnkk
134 New Member
Hi there,

Kindly refer to below modified code segment, hope it helps. Good luck & Take care.

Expand|Select|Wrap|Line Numbers
  1.   strmess = ""
  2.   strmess = "SELECT * from tblinvoicelines  WHERE invoice=" & newInvo
  3.   red1.Open strmess, CurrentProject.Connection, _
  4.             adOpenKeyset, adLockOptimistic
  5.  
I copy your statement, I got an error message - Run time error - 3705
Operation is not allowed when the object is open.
Dec 24 '06 #5
willakawill
1,646 Top Contributor
I copy your statement, I got an error message - Run time error - 3705
Operation is not allowed when the object is open.
that is because you have already opened the recordset earlier in your code.
insert this just before the code that you posted above:
red1.Close
Dec 24 '06 #6
willakawill
1,646 Top Contributor
BTW it is much better to explicitly initialize your recordset like this:
Expand|Select|Wrap|Line Numbers
  1. Dim red1 As ADODB.Recordset
  2. Set red1 = New ADODB.Recordset
If you do it this way:
Expand|Select|Wrap|Line Numbers
  1. Dim red1 As New ADODB.Recordset
each time you use red1 it will be checked to see if has been initialized which is inefficient
Dec 24 '06 #7
jamesnkk
134 New Member
BTW it is much better to explicitly initialize your recordset like this:
Expand|Select|Wrap|Line Numbers
  1. Dim red1 As ADODB.Recordset
  2. Set red1 = New ADODB.Recordset
If you do it this way:
Expand|Select|Wrap|Line Numbers
  1. Dim red1 As New ADODB.Recordset
each time you use red1 it will be checked to see if has been initialized which is inefficient
Wow !, Thank so much for your coding, I got it work now !, and Thank so Much for the explanation. Also Thank Sashi, Thank God, I came to the right forum.
Dec 24 '06 #8
sashi
1,754 Recognized Expert Top Contributor
Wow !, Thank so much for your coding, I got it work now !, and Thank so Much for the explanation. Also Thank Sashi, Thank God, I came to the right forum.
Hi there,

Good luck & Take care.
Dec 26 '06 #9

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

Similar topics

8
12090
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.
11
21917
by: Ken Varn | last post by:
I want to be able to determine my current line, file, and function in my C# application. I know that C++ has the __LINE__, __FUNCTION__, and __FILE___ macros for getting this, but I cannot find a C# equivalent. Any ideas? -- ----------------------------------- Ken Varn Senior Software Engineer Diebold Inc. varnk@diebold.com
2
3037
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
4
2919
by: bfulford | last post by:
I have a macro that needs to have a progress meter displayed since it is long running. I moved the Macro's instructions to a table and pulled those records into a recordset that is looped through. PROBLEM -- The form, with a progress meter and labels to inform the user as to which step of a series of instructions is being done and the overall progress, seems to lock from repainting after the first docmd.openquery because the form is never...
5
3740
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
24312
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.
9
1652
by: AG | last post by:
Using VS2005 Pro. I just deployed a ASP.NET 2.0 website (not web application) with the option to make it updatable. VS deployed all aspx, ascx files, but not all image or html files. It also deployed dll's and .compiled files into the bin folder of the site. This all looked fine and the site worked except for the missing image, html and some other third party control support files that I then had to manually upload.
9
16223
by: BlackMustard | last post by:
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. ' Open database connection Set adoConn = CreateObject("ADODB.Connection")
2
5706
by: =?Utf-8?B?TUNN?= | last post by:
I have an asp.net page that contains an update panel. Within the update panel, controls get added dynamically. During partial page post backs the controls within the panel will change. I have a javascript function that uses the ClientID of the dynamic controls to perform certain operations on the client-side. With each partial page post back, I dynamically recreate the javascript function using the ClientIDs of the newly added controls....
0
8407
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
8319
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
8739
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8512
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8612
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
4329
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2739
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1969
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1732
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.