473,778 Members | 1,862 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Current Recordset does not support updating - HELP needed!

I've come up with an error which the solution eludes me. I get the
error:
An unhandled exception of type 'System.Runtime .InteropService s.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. I'm using MS Access
2003 as the database.

The error appears to be quite self-explanatary, but I've read about
the locktype an it seems correct. The "Current Recordset" I'm unsure
of. I just want to find out if the record is on file and if not, add
it, otherwise I'll update it.

Sounds simple, but I need help.

Thanks,

Hexman

---------------------------------------------------------------------------------------------------
Imports System.Data.Ole Db
'
'
'
Public Class Form1

Inherits System.Windows. Forms.Form
'
'
'
Public db As ADODB.Connectio n
Public C As ADODB.Command
Public POrstData As ADODB.Recordset

Private Sub DoUpdate()

'make connection and open database
db = New ADODB.Connectio n

db.ConnectionSt ring = "Provider=Micro soft.Jet.OLEDB. 4.0;Data
Source=" & txtDatabaseDir & "HRMDB.MDB" &
";Persist Security Info=False"

db.Open()

C = New ADODB.Command
C.ActiveConnect ion = db
C.CommandType = ADODB.CommandTy peEnum.adCmdTex t

'create and open record set

POrstData = New ADODB.Recordset
POrstData.Open( "PurOrd", db,
ADODB.CursorTyp eEnum.adOpenkey set,
ADODB.LockTypeE num.adLockOptim istic, True)

End Sub

Private Sub UpdateProcess()

C.CommandText = "Select PODate, POLoc, POItem FROM PurOrd " & _
"where PODate = #" & SelectedDate & "# and POLoc = '" & strLoc & "' "
& _
"AND POItem = " & CInt(strItem)

POrstData = C.Execute

If POrstData.EOF = True Then
POrstData.AddNe w() <======= Fails with Error =====
POrstData.Field s.Item("PODate" ).Value = "#" & strDate & "#"
POrstData.Field s.Item("POLoc") .Value = strLoc
POrstData.Field s.Item("POItem" ).Value = CInt(strItem)
POrstData.Updat e()
Else
MsgBox("Record Found: #" & SelectedDate & "# " & strLoc & " "
& CInt(strItem))
End If

End Sub

Feb 20 '06 #1
5 3750
Hexman wrote:
I've come up with an error which the solution eludes me. I get the
error:

An unhandled exception of type 'System.Runtime .InteropService s.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. I'm using MS Access
2003 as the database.

The error appears to be quite self-explanatary, but I've read about
the locktype an it seems correct. The "Current Recordset" I'm unsure
of. I just want to find out if the record is on file and if not, add
it, otherwise I'll update it.

Sounds simple, but I need help.

Thanks,

Hexman

---------------------------------------------------------------------------------------------------
Imports System.Data.Ole Db
'
'
'
Public Class Form1

Inherits System.Windows. Forms.Form
'
'
'
Public db As ADODB.Connectio n
Public C As ADODB.Command
Public POrstData As ADODB.Recordset

Private Sub DoUpdate()

'make connection and open database
db = New ADODB.Connectio n

db.ConnectionSt ring = "Provider=Micro soft.Jet.OLEDB. 4.0;Data
Source=" & txtDatabaseDir & "HRMDB.MDB" &
";Persist Security Info=False"

db.Open()

C = New ADODB.Command
C.ActiveConnect ion = db
C.CommandType = ADODB.CommandTy peEnum.adCmdTex t

'create and open record set

POrstData = New ADODB.Recordset
POrstData.Open( "PurOrd", db,
ADODB.CursorTyp eEnum.adOpenkey set,
ADODB.LockTypeE num.adLockOptim istic, True)

End Sub

Private Sub UpdateProcess()

C.CommandText = "Select PODate, POLoc, POItem FROM PurOrd " & _
"where PODate = #" & SelectedDate & "# and POLoc = '" & strLoc & "' "
& _
"AND POItem = " & CInt(strItem)

POrstData = C.Execute

If POrstData.EOF = True Then
POrstData.AddNe w() <======= Fails with Error =====
POrstData.Field s.Item("PODate" ).Value = "#" & strDate & "#"
POrstData.Field s.Item("POLoc") .Value = strLoc
POrstData.Field s.Item("POItem" ).Value = CInt(strItem)
POrstData.Updat e()
Else
MsgBox("Record Found: #" & SelectedDate & "# " & strLoc & " "
& CInt(strItem))
End If

End Sub


Why are you using old ADO and not ADO.NET?

Chris
Feb 21 '06 #2
On Mon, 20 Feb 2006 21:59:50 -0500, Chris <no@spam.com> wrote:
Hexman wrote:
I've come up with an error which the solution eludes me. I get the
error:

An unhandled exception of type 'System.Runtime .InteropService s.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. I'm using MS Access
2003 as the database.

The error appears to be quite self-explanatary, but I've read about
the locktype an it seems correct. The "Current Recordset" I'm unsure
of. I just want to find out if the record is on file and if not, add
it, otherwise I'll update it.

Sounds simple, but I need help.

Thanks,

Hexman

---------------------------------------------------------------------------------------------------
Imports System.Data.Ole Db
'
'
'
Public Class Form1

Inherits System.Windows. Forms.Form
'
'
'
Public db As ADODB.Connectio n
Public C As ADODB.Command
Public POrstData As ADODB.Recordset

Private Sub DoUpdate()

'make connection and open database
db = New ADODB.Connectio n

db.ConnectionSt ring = "Provider=Micro soft.Jet.OLEDB. 4.0;Data
Source=" & txtDatabaseDir & "HRMDB.MDB" &
";Persist Security Info=False"

db.Open()

C = New ADODB.Command
C.ActiveConnect ion = db
C.CommandType = ADODB.CommandTy peEnum.adCmdTex t

'create and open record set

POrstData = New ADODB.Recordset
POrstData.Open( "PurOrd", db,
ADODB.CursorTyp eEnum.adOpenkey set,
ADODB.LockTypeE num.adLockOptim istic, True)

End Sub

Private Sub UpdateProcess()

C.CommandText = "Select PODate, POLoc, POItem FROM PurOrd " & _
"where PODate = #" & SelectedDate & "# and POLoc = '" & strLoc & "' "
& _
"AND POItem = " & CInt(strItem)

POrstData = C.Execute

If POrstData.EOF = True Then
POrstData.AddNe w() <======= Fails with Error =====
POrstData.Field s.Item("PODate" ).Value = "#" & strDate & "#"
POrstData.Field s.Item("POLoc") .Value = strLoc
POrstData.Field s.Item("POItem" ).Value = CInt(strItem)
POrstData.Updat e()
Else
MsgBox("Record Found: #" & SelectedDate & "# " & strLoc & " "
& CInt(strItem))
End If

End Sub


Why are you using old ADO and not ADO.NET?

Chris

Its what I've had examples of. Please point me in the ADO.NET
direction. I need examples (add, delete, query, update, etc.)

Thanks,

Hexman

Feb 21 '06 #3
Look in the .net Framework SDK... it has several examples of ado.net

http://msdn.microsoft.com/netframework/

"Hexman" wrote:
On Mon, 20 Feb 2006 21:59:50 -0500, Chris <no@spam.com> wrote:
Hexman wrote:
I've come up with an error which the solution eludes me. I get the
error:
An unhandled exception of type 'System.Runtime .InteropService s.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. I'm using MS Access
2003 as the database.

The error appears to be quite self-explanatary, but I've read about
the locktype an it seems correct. The "Current Recordset" I'm unsure
of. I just want to find out if the record is on file and if not, add
it, otherwise I'll update it.

Sounds simple, but I need help.

Thanks,

Hexman

---------------------------------------------------------------------------------------------------
Imports System.Data.Ole Db
'
'
'
Public Class Form1

Inherits System.Windows. Forms.Form
'
'
'
Public db As ADODB.Connectio n
Public C As ADODB.Command
Public POrstData As ADODB.Recordset

Private Sub DoUpdate()

'make connection and open database
db = New ADODB.Connectio n

db.ConnectionSt ring = "Provider=Micro soft.Jet.OLEDB. 4.0;Data
Source=" & txtDatabaseDir & "HRMDB.MDB" &
";Persist Security Info=False"

db.Open()

C = New ADODB.Command
C.ActiveConnect ion = db
C.CommandType = ADODB.CommandTy peEnum.adCmdTex t

'create and open record set

POrstData = New ADODB.Recordset
POrstData.Open( "PurOrd", db,
ADODB.CursorTyp eEnum.adOpenkey set,
ADODB.LockTypeE num.adLockOptim istic, True)

End Sub

Private Sub UpdateProcess()

C.CommandText = "Select PODate, POLoc, POItem FROM PurOrd " & _
"where PODate = #" & SelectedDate & "# and POLoc = '" & strLoc & "' "
& _
"AND POItem = " & CInt(strItem)

POrstData = C.Execute

If POrstData.EOF = True Then
POrstData.AddNe w() <======= Fails with Error =====
POrstData.Field s.Item("PODate" ).Value = "#" & strDate & "#"
POrstData.Field s.Item("POLoc") .Value = strLoc
POrstData.Field s.Item("POItem" ).Value = CInt(strItem)
POrstData.Updat e()
Else
MsgBox("Record Found: #" & SelectedDate & "# " & strLoc & " "
& CInt(strItem))
End If

End Sub


Why are you using old ADO and not ADO.NET?

Chris

Its what I've had examples of. Please point me in the ADO.NET
direction. I need examples (add, delete, query, update, etc.)

Thanks,

Hexman

Feb 21 '06 #4
OK,

I looked at the examples in the SDK and other internet sources --- and
now I'm even more confused. I wish there was an example of someone
reading a transaction file and updating a table (add, update & delete
based on the transaction type). I've seen ASP code, C code & VB code
with ADO classic and ADO.NET, some with SQL, OleDB, ODBC, .....

Don't know which way to turn - just trying to get this task finished
(along with being guided down the correct path of learning about
this).

I've seen so much it really bluring. I thought my approach in the
code below was a good solution, but apparently not.

I need more help.

Can someone guide me closer to the objective?

Thanks,

Hexman

On Mon, 20 Feb 2006 20:37:18 -0800, "Denny" <st*****@commun ity.nospam>
wrote:
Look in the .net Framework SDK... it has several examples of ado.net

http://msdn.microsoft.com/netframework/

"Hexman" wrote:
On Mon, 20 Feb 2006 21:59:50 -0500, Chris <no@spam.com> wrote:
>Hexman wrote:
>> I've come up with an error which the solution eludes me. I get the
>> error:
>>
>>
>>>An unhandled exception of type 'System.Runtime .InteropService s.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. I'm using MS Access
>> 2003 as the database.
>>
>> The error appears to be quite self-explanatary, but I've read about
>> the locktype an it seems correct. The "Current Recordset" I'm unsure
>> of. I just want to find out if the record is on file and if not, add
>> it, otherwise I'll update it.
>>
>> Sounds simple, but I need help.
>>
>> Thanks,
>>
>> Hexman
>>
>> ---------------------------------------------------------------------------------------------------
>> Imports System.Data.Ole Db
>> '
>> '
>> '
>> Public Class Form1
>>
>> Inherits System.Windows. Forms.Form
>> '
>> '
>> '
>> Public db As ADODB.Connectio n
>> Public C As ADODB.Command
>> Public POrstData As ADODB.Recordset
>>
>> Private Sub DoUpdate()
>>
>> 'make connection and open database
>> db = New ADODB.Connectio n
>>
>> db.ConnectionSt ring = "Provider=Micro soft.Jet.OLEDB. 4.0;Data
>> Source=" & txtDatabaseDir & "HRMDB.MDB" &
>> ";Persist Security Info=False"
>>
>> db.Open()
>>
>> C = New ADODB.Command
>> C.ActiveConnect ion = db
>> C.CommandType = ADODB.CommandTy peEnum.adCmdTex t
>>
>> 'create and open record set
>>
>> POrstData = New ADODB.Recordset
>> POrstData.Open( "PurOrd", db,
>> ADODB.CursorTyp eEnum.adOpenkey set,
>> ADODB.LockTypeE num.adLockOptim istic, True)
>>
>> End Sub
>>
>> Private Sub UpdateProcess()
>>
>> C.CommandText = "Select PODate, POLoc, POItem FROM PurOrd " & _
>> "where PODate = #" & SelectedDate & "# and POLoc = '" & strLoc & "' "
>> & _
>> "AND POItem = " & CInt(strItem)
>>
>> POrstData = C.Execute
>>
>> If POrstData.EOF = True Then
>> POrstData.AddNe w() <======= Fails with Error =====
>> POrstData.Field s.Item("PODate" ).Value = "#" & strDate & "#"
>> POrstData.Field s.Item("POLoc") .Value = strLoc
>> POrstData.Field s.Item("POItem" ).Value = CInt(strItem)
>> POrstData.Updat e()
>> Else
>> MsgBox("Record Found: #" & SelectedDate & "# " & strLoc & " "
>> & CInt(strItem))
>> End If
>>
>> End Sub
>>
>
>Why are you using old ADO and not ADO.NET?
>
>Chris

Its what I've had examples of. Please point me in the ADO.NET
direction. I need examples (add, delete, query, update, etc.)

Thanks,

Hexman


Feb 23 '06 #5
OK,

I looked at the examples in the SDK and other internet sources --- and
now I'm even more confused. I wish there was an example of someone
reading a transaction file and updating a table (add, update & delete
based on the transaction type). I've seen ASP code, C code & VB code
with ADO classic and ADO.NET, some with SQL, OleDB, ODBC, .....

Don't know which way to turn - just trying to get this task finished
(along with being guided down the correct path of learning about
this).

I've seen so much it really bluring. I thought my approach in the
code below was a good solution, but apparently not.

I need more help.

Can someone guide me closer to the objective?

Thanks,

Hexman

On Mon, 20 Feb 2006 20:37:18 -0800, "Denny" <st*****@commun ity.nospam>
wrote:
Look in the .net Framework SDK... it has several examples of ado.net

http://msdn.microsoft.com/netframework/

"Hexman" wrote:
On Mon, 20 Feb 2006 21:59:50 -0500, Chris <no@spam.com> wrote:
>Hexman wrote:
>> I've come up with an error which the solution eludes me. I get the
>> error:
>>
>>
>>>An unhandled exception of type 'System.Runtime .InteropService s.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. I'm using MS Access
>> 2003 as the database.
>>
>> The error appears to be quite self-explanatary, but I've read about
>> the locktype an it seems correct. The "Current Recordset" I'm unsure
>> of. I just want to find out if the record is on file and if not, add
>> it, otherwise I'll update it.
>>
>> Sounds simple, but I need help.
>>
>> Thanks,
>>
>> Hexman
>>
>> ---------------------------------------------------------------------------------------------------
>> Imports System.Data.Ole Db
>> '
>> '
>> '
>> Public Class Form1
>>
>> Inherits System.Windows. Forms.Form
>> '
>> '
>> '
>> Public db As ADODB.Connectio n
>> Public C As ADODB.Command
>> Public POrstData As ADODB.Recordset
>>
>> Private Sub DoUpdate()
>>
>> 'make connection and open database
>> db = New ADODB.Connectio n
>>
>> db.ConnectionSt ring = "Provider=Micro soft.Jet.OLEDB. 4.0;Data
>> Source=" & txtDatabaseDir & "HRMDB.MDB" &
>> ";Persist Security Info=False"
>>
>> db.Open()
>>
>> C = New ADODB.Command
>> C.ActiveConnect ion = db
>> C.CommandType = ADODB.CommandTy peEnum.adCmdTex t
>>
>> 'create and open record set
>>
>> POrstData = New ADODB.Recordset
>> POrstData.Open( "PurOrd", db,
>> ADODB.CursorTyp eEnum.adOpenkey set,
>> ADODB.LockTypeE num.adLockOptim istic, True)
>>
>> End Sub
>>
>> Private Sub UpdateProcess()
>>
>> C.CommandText = "Select PODate, POLoc, POItem FROM PurOrd " & _
>> "where PODate = #" & SelectedDate & "# and POLoc = '" & strLoc & "' "
>> & _
>> "AND POItem = " & CInt(strItem)
>>
>> POrstData = C.Execute
>>
>> If POrstData.EOF = True Then
>> POrstData.AddNe w() <======= Fails with Error =====
>> POrstData.Field s.Item("PODate" ).Value = "#" & strDate & "#"
>> POrstData.Field s.Item("POLoc") .Value = strLoc
>> POrstData.Field s.Item("POItem" ).Value = CInt(strItem)
>> POrstData.Updat e()
>> Else
>> MsgBox("Record Found: #" & SelectedDate & "# " & strLoc & " "
>> & CInt(strItem))
>> End If
>>
>> End Sub
>>
>
>Why are you using old ADO and not ADO.NET?
>
>Chris

Its what I've had examples of. Please point me in the ADO.NET
direction. I need examples (add, delete, query, update, etc.)

Thanks,

Hexman


Feb 24 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
3092
by: Tom | last post by:
I want to open a recordset object on an .asp page. When I open the recordset I would like to use a stored procedure that expects a parameter to be passed for the stored procedure. I will then use the recordset to loop thru the recordset, update values from the recordset and then update the database by passing parmeters to another stored procedure. I would like to use the recordset object but can it be used to pass a parameter to a stored...
3
17531
by: jm | last post by:
I have a simple query. It has two tables. If I open the tables separately, I can add records. If I open them up together, the recordset is not updateable. As best I know, this has never been a problem it just happened all of a sudden. - The database has been repaired and converted several times to no avail. - All the permissions are correct. - Copying and pasting the table and query in the same database does
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.
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
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
9
16243
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")
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
10127
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
10068
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
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...
1
7474
isladogs
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5497
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4031
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

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.