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(strmess)
If Not red1.EOF Then
red1.MoveFirst
Do While Not red1.EOF
If red1!Invoice = newInvo Then
red1.Fields("amount") = 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 ?
8 7464 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(strmess)
If Not red1.EOF Then
red1.MoveFirst
Do While Not red1.EOF
If red1!Invoice = newInvo Then
red1.Fields("amount") = 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. -
strmess = ""
-
strmess = "SELECT * from tblinvoicelines WHERE invoice=" & newInvo
-
red1.Open strmess, CurrentProject.Connection, _
-
adOpenKeyset, adLockOptimistic
-
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(strmess)
If Not red1.EOF Then
red1.MoveFirst
Do While Not red1.EOF
If red1!Invoice = newInvo Then
red1.Fields("amount") = 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..
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.
Hi there,
Kindly refer to below modified code segment, hope it helps. Good luck & Take care. -
strmess = ""
-
strmess = "SELECT * from tblinvoicelines WHERE invoice=" & newInvo
-
red1.Open strmess, CurrentProject.Connection, _
-
adOpenKeyset, adLockOptimistic
-
I copy your statement, I got an error message - Run time error - 3705
Operation is not allowed when the object is open.
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
BTW it is much better to explicitly initialize your recordset like this: - Dim red1 As ADODB.Recordset
-
Set red1 = New ADODB.Recordset
If you do it this way: - Dim red1 As New ADODB.Recordset
each time you use red1 it will be checked to see if has been initialized which is inefficient
BTW it is much better to explicitly initialize your recordset like this: - Dim red1 As ADODB.Recordset
-
Set red1 = New ADODB.Recordset
If you do it this way: - 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.
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.
Sign in to post your reply or Sign up for a free account.
Similar topics
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...
|
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...
|
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....
|
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....
|
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...
|
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...
|
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...
|
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.
...
|
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...
|
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...
|
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,...
|
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...
|
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...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
|
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...
|
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...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
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 ...
| |