473,408 Members | 2,009 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

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.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. 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.OleDb
'
'
'
Public Class Form1

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

Private Sub DoUpdate()

'make connection and open database
db = New ADODB.Connection

db.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=" & txtDatabaseDir & "HRMDB.MDB" &
";Persist Security Info=False"

db.Open()

C = New ADODB.Command
C.ActiveConnection = db
C.CommandType = ADODB.CommandTypeEnum.adCmdText

'create and open record set

POrstData = New ADODB.Recordset
POrstData.Open("PurOrd", db,
ADODB.CursorTypeEnum.adOpenkeyset,
ADODB.LockTypeEnum.adLockOptimistic, 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.AddNew() <======= Fails with Error =====
POrstData.Fields.Item("PODate").Value = "#" & strDate & "#"
POrstData.Fields.Item("POLoc").Value = strLoc
POrstData.Fields.Item("POItem").Value = CInt(strItem)
POrstData.Update()
Else
MsgBox("Record Found: #" & SelectedDate & "# " & strLoc & " "
& CInt(strItem))
End If

End Sub

Feb 20 '06 #1
5 3700
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.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. 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.OleDb
'
'
'
Public Class Form1

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

Private Sub DoUpdate()

'make connection and open database
db = New ADODB.Connection

db.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=" & txtDatabaseDir & "HRMDB.MDB" &
";Persist Security Info=False"

db.Open()

C = New ADODB.Command
C.ActiveConnection = db
C.CommandType = ADODB.CommandTypeEnum.adCmdText

'create and open record set

POrstData = New ADODB.Recordset
POrstData.Open("PurOrd", db,
ADODB.CursorTypeEnum.adOpenkeyset,
ADODB.LockTypeEnum.adLockOptimistic, 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.AddNew() <======= Fails with Error =====
POrstData.Fields.Item("PODate").Value = "#" & strDate & "#"
POrstData.Fields.Item("POLoc").Value = strLoc
POrstData.Fields.Item("POItem").Value = CInt(strItem)
POrstData.Update()
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.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. 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.OleDb
'
'
'
Public Class Form1

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

Private Sub DoUpdate()

'make connection and open database
db = New ADODB.Connection

db.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=" & txtDatabaseDir & "HRMDB.MDB" &
";Persist Security Info=False"

db.Open()

C = New ADODB.Command
C.ActiveConnection = db
C.CommandType = ADODB.CommandTypeEnum.adCmdText

'create and open record set

POrstData = New ADODB.Recordset
POrstData.Open("PurOrd", db,
ADODB.CursorTypeEnum.adOpenkeyset,
ADODB.LockTypeEnum.adLockOptimistic, 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.AddNew() <======= Fails with Error =====
POrstData.Fields.Item("PODate").Value = "#" & strDate & "#"
POrstData.Fields.Item("POLoc").Value = strLoc
POrstData.Fields.Item("POItem").Value = CInt(strItem)
POrstData.Update()
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.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. 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.OleDb
'
'
'
Public Class Form1

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

Private Sub DoUpdate()

'make connection and open database
db = New ADODB.Connection

db.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=" & txtDatabaseDir & "HRMDB.MDB" &
";Persist Security Info=False"

db.Open()

C = New ADODB.Command
C.ActiveConnection = db
C.CommandType = ADODB.CommandTypeEnum.adCmdText

'create and open record set

POrstData = New ADODB.Recordset
POrstData.Open("PurOrd", db,
ADODB.CursorTypeEnum.adOpenkeyset,
ADODB.LockTypeEnum.adLockOptimistic, 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.AddNew() <======= Fails with Error =====
POrstData.Fields.Item("PODate").Value = "#" & strDate & "#"
POrstData.Fields.Item("POLoc").Value = strLoc
POrstData.Fields.Item("POItem").Value = CInt(strItem)
POrstData.Update()
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*****@community.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.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. 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.OleDb
>> '
>> '
>> '
>> Public Class Form1
>>
>> Inherits System.Windows.Forms.Form
>> '
>> '
>> '
>> Public db As ADODB.Connection
>> Public C As ADODB.Command
>> Public POrstData As ADODB.Recordset
>>
>> Private Sub DoUpdate()
>>
>> 'make connection and open database
>> db = New ADODB.Connection
>>
>> db.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data
>> Source=" & txtDatabaseDir & "HRMDB.MDB" &
>> ";Persist Security Info=False"
>>
>> db.Open()
>>
>> C = New ADODB.Command
>> C.ActiveConnection = db
>> C.CommandType = ADODB.CommandTypeEnum.adCmdText
>>
>> 'create and open record set
>>
>> POrstData = New ADODB.Recordset
>> POrstData.Open("PurOrd", db,
>> ADODB.CursorTypeEnum.adOpenkeyset,
>> ADODB.LockTypeEnum.adLockOptimistic, 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.AddNew() <======= Fails with Error =====
>> POrstData.Fields.Item("PODate").Value = "#" & strDate & "#"
>> POrstData.Fields.Item("POLoc").Value = strLoc
>> POrstData.Fields.Item("POItem").Value = CInt(strItem)
>> POrstData.Update()
>> 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*****@community.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.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. 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.OleDb
>> '
>> '
>> '
>> Public Class Form1
>>
>> Inherits System.Windows.Forms.Form
>> '
>> '
>> '
>> Public db As ADODB.Connection
>> Public C As ADODB.Command
>> Public POrstData As ADODB.Recordset
>>
>> Private Sub DoUpdate()
>>
>> 'make connection and open database
>> db = New ADODB.Connection
>>
>> db.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data
>> Source=" & txtDatabaseDir & "HRMDB.MDB" &
>> ";Persist Security Info=False"
>>
>> db.Open()
>>
>> C = New ADODB.Command
>> C.ActiveConnection = db
>> C.CommandType = ADODB.CommandTypeEnum.adCmdText
>>
>> 'create and open record set
>>
>> POrstData = New ADODB.Recordset
>> POrstData.Open("PurOrd", db,
>> ADODB.CursorTypeEnum.adOpenkeyset,
>> ADODB.LockTypeEnum.adLockOptimistic, 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.AddNew() <======= Fails with Error =====
>> POrstData.Fields.Item("PODate").Value = "#" & strDate & "#"
>> POrstData.Fields.Item("POLoc").Value = strLoc
>> POrstData.Fields.Item("POItem").Value = CInt(strItem)
>> POrstData.Update()
>> 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
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...
3
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...
8
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...
2
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....
9
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...
3
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: ...
8
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...
9
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. ...
0
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...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
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,...
0
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...
0
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 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.