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")
-
adoConn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source = " & strArchivePath & "mailarchive.mdb" & ";User ID=Admin;Password=;"
-
adoConn.Open
-
-
' Open recordset
-
Set adoRecSet = New ADODB.Recordset
-
adoRecSet.Open "SELECT * FROM tblEmail ORDER BY ISS ASC", adoConn, adOpenKeyset, adLockOptimistic
-
-
adoRecSet.MoveLast
-
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?
9 16182 QVeen72 1,445
Recognized Expert Top Contributor
Hi,
Change this : -
adoRecSet.Open "SELECT * FROM tblEmail ORDER BY ISS ASC", adoConn, adOpenDynamic, adLockOptimistic
-
Change KeySet to Dynamic..
REgards
Veena
Hi,
Change this : -
adoRecSet.Open "SELECT * FROM tblEmail ORDER BY ISS ASC", adoConn, adOpenDynamic, adLockOptimistic
-
Change KeySet to Dynamic..
REgards
Veena
I did, but still get the same error... :S
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. - ' Open database connection
-
Set adoConn = CreateObject("ADODB.Connection")
-
adoConn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source = " & strArchivePath & "mailarchive.mdb" & ";User ID=Admin;Password=;"
-
adoConn.Open
-
-
' Open recordset
-
Set adoRecSet = New ADODB.Recordset
-
adoRecSet.Open "SELECT * FROM tblEmail ORDER BY ISS ASC", adoConn, adOpenKeyset, adLockOptimistic
-
-
adoRecSet.MoveLast
-
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
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
I have included a library called "Microsoft ActiveX Data Objects 2.7 Library", and I changed the declarations in (General) to the following: - Dim adoConn As New ADODB.Connection
-
Dim adoRecSet As New ADODB.RecordSet
In my code, i then removed the "Set" commands, leaving the code at - ' Open database connection
-
adoConn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source = " & strArchivePath & "mailarchive.mdb" & ";User ID=Admin;Password=;"
-
adoConn.Open
-
-
' Open recordset
-
adoRecSet.Open "SELECT * FROM tblEmail ORDER BY ISS ASC", adoConn, adOpenDynamic, adLockOptimistic
-
-
' Add record
-
adoRecSet.MoveLast
-
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.
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.
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
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?
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: 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...
|
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: 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: 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: ...
|
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...
|
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...
|
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...
|
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,...
|
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: 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...
|
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: 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,...
|
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?
| |