Solved

Error # -2147164145

Posted on 2000-04-19
5
628 Views
Last Modified: 2012-08-13
I'm getting an error -2147164145, but I can't find any articles on it that explains what this error is. Do you have an explanation, and where could I find details on errors for future reference?  The error occurs when an object's fetch method is about to be called.  Here is the exact error message:

Method 'Fetch' of object '_SubProducerPersist' failed, Sql: SELECT LIC_SAPS.*, LIC_CLIENTS.CORPORATE_NAME , LIC_CLIENTS.SOCIAL_SECURITY_NO, LIC_CLIENTS.FEDERAL_ID_NUMBER, LIC_CLIENTS.ZYXCOR_CLIENT_NO, LIC_CLIENTS.FIRST_NAME, LIC_CLIENTS.LAST_NAME, LIC_CLIENTS.MIDDLE_INITIAL, LIC_CLIENTS.BUSINESS_ADDRESS1, LIC_CLIENTS.BUSINESS_ADDRESS2, LIC_CLIENTS.BUSINESS_CITY, LIC_CLIENTS.BUSINESS_STATE, LIC_CLIENTS.BUSINESS_ZIP, LIC_CLIENTS.RESIDENT_CITY, LIC_CLIENTS.RESIDENT_STATE, LIC_CLIENTS.BRANCH_LOCATION FROM LIC_SAPS, LIC_CLIENTS, LIC_ROLES WHERE LIC_SAPS.CLIENT_ID = LIC_CLIENTS.CLIENT_ID AND LIC_SAPS.ROLE_ID = LIC_ROLES.ROLE_ID AND UPPER(LIC_ROLES.DESCRIPTION) = 'PRODUCER' AND SAP_ID=779164

Error: -2147164145
Source: dcBRH, dcBRH:ProducerPersist:Fetch

I use Visual Basic ver6.0 (SP3), on Windows NT.
0
Comment
Question by:adias6
5 Comments
 
LVL 17

Expert Comment

by:calacuccia
ID: 2731579
Hi Adias6,

Here's already a list on what error mesaages of this kind mean (but your error message is not there):
http://support.microsoft.com/support/kb/articles/q186/0/63.asp

Could you specify how & when you get this error, the additional info given also (complete error message), the Software (+Version) you use..

Al that info can only help to find the meaning of error-messages.

Calacuccia
0
 

Author Comment

by:adias6
ID: 2731653
Edited text of question.
0
 
LVL 1

Accepted Solution

by:
sramkris earned 50 total points
ID: 2731745
PRB: Err Message: "Runtime Error -2147217885 (80040e23) : A Given HROW Referred to a Hard- or Soft- Deleted Row"

--------------------------------------------------------------------------------
The information in this article applies to:

Microsoft Visual Basic Learning, Professional, and Enterprise Editions for Windows, version 6.0
ActiveX Data Objects (ADO), versions 2.0, 2.1, 2.1 SP1, 2.1 SP2

--------------------------------------------------------------------------------


SYMPTOMS
If you try to access the Value property of a field that is in a record marked for deletion, in an optimistic batch update operation, after you set the disconnected Recordset's filter property to adFilterPendingRecords the following run-time error occurs:

Run-time error '-2147217885(8004e23)' : A given HROW referred to a hard- or soft-deleted row.



CAUSE
After a record has been deleted in a disconnected ADO Recordset by executing the rs.Delete method, you cannot access the Value property of it's constituent fields in code.



RESOLUTION
To access the values that were stored in the fields of the deleted record, use the Field Object's OriginalValue or UnderlyingValue property.



STATUS
This behavior is by design.



MORE INFORMATION
In an optimistic batch update operation, disconnected recordsets are updated locally on the client computer. Then the disconnected recordsets are associated with an active connection to post the changes made to the database. The changes might include:

The addition of new records.
Modification's to the values stored in the fields of existing records.
Deletion of records in the disconnected recordset.
It is a common practice to examine the changes made to the disconnected recordset locally before you connect and apply the changes to the database. The Filter property of the ADO recordset can be set to the ADO constant value adFilterPendingRecords to identify the records in the disconnected recordset that have changed, and which will be applied to the database on the next call to the UpdateBatch method.

Setting the recordset's Filter property to adFilterPendingRecords enforces a filter on the recordset object so that the view of its constituent records is restricted to the records changed in the disconnected recordset that have not been posted to the database. After you set the filter it is possible to loop through the records and examine the Status property of each record to determine whether a record has been added, changed, or deleted. Deleted records have their status property set to adStatusDeleted.

While it is possible to access the values in the fields of the newly added and modified records by using the ADO Field object's Value property, doing the same for the deleted records results in the run-time error shown in the "Symptoms" section. The values that were stored in the fields of the records marked for deletion can only be accessed through the OriginalValue or UnderlyingValue properties of the ADO Field object.

Steps to Reproduce Behavior
Use the following code example to reproduce this problem. This example uses the Biblio.mdb Microsoft Access database that is installed with Visual Basic 6.0.


Start a new Standard EXE project in Visual Basic 6.0.


Set a Project reference to the Microsoft ActiveX Data Objects 2.1 Library.


Drag and drop a Command button onto Form1.


In the Form's General Declarations section make the following declarations:


  Dim cn as ADODB.Connection
  Dim rs as ADODB.Recordset
Place this code in the command button's Click Event procedure:


Private Sub Command1_Click()
  Set cn = New ADODB.Connection
  cn.ConnectionString = Provider=Microsoft.Jet.OLEDB.4.0;Data Source=Biblio.mdb"
  cn.Open

  Set rs = New ADODB.Recordset
  rs.CursorLocation = adUseClient
  rs.Open "Select * from [Title Author]", cn, adOpenStatic,   adLockBatchOptimistic
  'THE RECORDSET IS DISCONNECTED
  Set rs.ActiveConnection = Nothing

  rs.MoveFirst
  rs.Delete
  rs.Filter = adFilterPendingRecords
  Do While Not rs.EOF
    If rs.Status = adRecDeleted Then                                                          
      MsgBox "ISBN : " & rs.Fields("ISBN") & " has been deleted !" 'THE ERROR OCCURS ON THIS LINE
    End If
    rs.MoveNext
  Loop
  rs.Filter = adFilterNone
  rs.Filter = adFilterNone

  Set rs.ActiveConnection = cn
  rs.CancelBatch
  rs.Close
End Sub
Press F5 to run the code. Note that the error is occurs. Now, in the preceding code segment replace the line:


    MsgBox "ISBN : " & rs.Fields("ISBN") & " has been deleted !"
with this line:
    MsgBox "ISBN : " & rs.Fields("ISBN").OriginalValue & " has been deleted !"
Now, note that you are able to see the value of the "ISBN" field in the record marked for deletion.
In the preceding example, the deletion is not posted to the database. The call to rs.CancelBatch ensures that the deletion is not reflected in the database.



Additional query words:

Keywords : kbADO kbVBp kbVBp600 kbGrpVBDB kbGrpMDAC kbDSupport
Version : WINDOWS:2.0,2.1,2.1 SP1,2.1 SP2,6.0
Platform : WINDOWS
Issue type : kbprb
Technology : kbvbpSearch
0
 
LVL 69

Expert Comment

by:Éric Moreau
ID: 2731873
What is your database engine?

Try pulling out the UPPER function.
0
 

Expert Comment

by:awestrope
ID: 2841939
I will give somebody and extra 500 points if they answer this question (not one about a different error number!) within 24 hours.

Andrew
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now