473,326 Members | 2,013 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,326 software developers and data experts.

Error: System.Runtime.EnteropServices.COMException (0x800A0CC1)

Dear all,

Am faced with the above problem. I am designing an application in VB.Net 2003 and using Ms Access 2000 as the database. I have the following code:

Expand|Select|Wrap|Line Numbers
  1.     Private Sub cmdSave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdSave.Click
  2.  
  3.         Try
  4.             Dim response As Short
  5.  
  6.             response = MsgBox("Is the above information correct?", MsgBoxStyle.YesNo, "UBOS")
  7.  
  8.             If response = MsgBoxResult.No Then
  9.                 cboStaffCode.Focus()
  10.                 Exit Sub
  11.  
  12.             Else
  13.                 If Not NewEduc Then
  14.                     rs.Fields(1).Value = cboStaffCode.Text
  15.                     rs.Fields(2).Value = cboQualification.Text
  16.                     rs.Fields(3).Value = txtInstitution.Text
  17.                     rs.Fields(4).Value = dtpDateStarted.Text
  18.                     rs.Fields(5).Value = dtpDateCompleted.Text
  19.                     rs.Fields(6).Value = cboAward.Text
  20.                     rs.Fields(7).Value = cboLevelofAward.Text
  21.                 Else
  22.                     OpenRecordset(("EducationAttainment"))
  23.                     rs.AddNew()
  24.                     rs.Fields(0).Value = cboRecNo.Text
  25.                     rs.Fields(1).Value = cboStaffCode.Text
  26.                     rs.Fields(2).Value = cboQualification.Text
  27.                     rs.Fields(3).Value = txtInstitution.Text
  28.                     rs.Fields(4).Value = dtpDateStarted.Text
  29.                     rs.Fields(5).Value = dtpDateCompleted.Text
  30.                     rs.Fields(6).Value = cboAward.Text
  31.                     rs.Fields(7).Value = cboLevelofAward.Text
  32.                 End If
  33.                 rs.Update()
  34.  
  35.                 MsgBox("1 Record Has Been Saved", MsgBoxStyle.OKOnly, "UBOS")
  36.             End If
  37.             cmdSave.Enabled = False
  38.         Catch ex As Exception
  39.             System.Windows.Forms.MessageBox.Show(ex.ToString)
  40.         End Try
  41.  
  42.  
When I save a new record I have no problem, the problem only arrises when I try to modify a record. I get the following Error Message:

Error: System.Runtime.EnteropServices.COMException (0x800A0CC1): Item cannot be found in the collection corresponding to the requested name or ordinal. at ADODB.Fields.get_Item(Object Index)

I ve checked several Forums but I ve failed to get a solution to my problem.


Mona
Oct 8 '07 #1
1 2831
kenobewan
4,871 Expert 4TB
Welcome to TSDN. Suggest writing messages to find out where it is falling over.
Oct 8 '07 #2

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

Similar topics

0
by: Don Stevic | last post by:
I am running VS2005 and using VSTO for Word. I keep getting this error saying that there is no source code available for this location when I try and run this application. I am going to...
4
by: IMS.Rushikesh | last post by:
Hi All, I am trying to execute below code but it gives me an COMException ///// Code Start //// public string GetName(Excel.Range range) { try { if (range.Name != null)
0
by: null_port | last post by:
Regarding Peter Bromberg's article on saving web pages as mht's using CDO: http://www.eggheadcafe.com/articles/20040527.asp I've been having fits when calling his sample code:...
4
by: neil brown | last post by:
Whenever I try and run a project in VB.NET 2003, all i get is: "An unhandled exception of type 'System.ArgumentException' occurred in Unknown Module. Additional information: The parameter is...
8
by: Philip Colmer | last post by:
I'm rewriting some existing VBScript into VB.Net code. It was all going well until I hit the following error when testing the code: System.Runtime.InteropServices.COMException (0x80041003) at...
1
by: Philip Colmer | last post by:
I'm rewriting some existing VBScript into VB.Net code. It was all going well until I hit the following error when testing the code: System.Runtime.InteropServices.COMException (0x80041003) at...
6
by: Tomas | last post by:
I'm trying in ASP.NET web page load user accounts from active directory. When I'm developing on local web server it works. I'm using authentication mode=windows and identity impersonate=true...
7
by: Kath | last post by:
Hi, I hope this is the most relevant newsgroup for this post. I have a VB.NET app that uses the MapPoint component, and in my app I use pushpins to display/retrieve GPS locations....
11
by: Don | last post by:
When using Visual Basic .NET with a reference to Interop.Outlook, is there a way to get more detailed information about an error other than Exception.Message or Exception.ToString? For example,...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.