ADO Recordset's strange behaviour when filtered using adFilterConflictingRecords 
Author Message
 ADO Recordset's strange behaviour when filtered using adFilterConflictingRecords

Introduction:

The application that I am wiriting should support multi users. Iam
trying to display a DataGrid in a form with its datasource set to an
instance of a class module which acts as a datasource. I've also set the
classes's dataSourceBehaviour property to 1 and have assigned the data
parameter in the getDataMember function in my class to
the appropriate recordset. In the VB form I've placed a DataGrid and
assigned it's dataSource to an instance of the above mentioned class. So
far it works fine.
When the data in the grid is updated with its new data, I want to
capture the conflicting records by using the adFilterConflictingRecords
property.
Here is some info regarding the recordset in the dataSource class.
The driver used here is "SQLOLDEDB" and I have an ADO Static recordset
with a Client Side cursor and the locking option set to
adLockBatchOptimistic.

Problem:

After running the program and made sure that the DataGrid in the form is
displaying the data form SQL Server I used the SQL Analyser to alter one
or two same records so that ADO can capture the conflicting records in
the VB program by filtering conflicting records.
When the Data in the Gird is updated, ADO raises the follwoing error

Run-time error: -2147217864 (80040e38):
The specified row could not be located for updating. Some values may
have been changed since it was last read.

Here is a strange behaviour of ADO.  This setting works fine (ADO
filters the correct amount of records that are conflicting)if the
recordset is created directly in the form itself. But does not filter
conflicting records when the recordset is used from an instance of a
datasource class where the DataSourceBehaviour property is set to 1. The
record count is always equal to the original recordset's record count
even after filtering the conflicting records.

I am pretty sure that my coding is correct. I may have made a mistake
somewhere or it may be a bug in ADO. Any help is appreciated. Thank you.

Anand.

*** Sent via Developersdex http://www.*-*-*.com/ ***
Don't just participate in USENET...get rewarded for it!



Sun, 01 Aug 2004 13:25:36 GMT  
 ADO Recordset's strange behaviour when filtered using adFilterConflictingRecords
Introduction:

The application that I am wiriting should support multi users. Iam
trying to display a DataGrid in a form with its datasource set to an
instance of a class module which acts as a datasource. I've also set the
classes's dataSourceBehaviour property to 1 and have assigned the data
parameter in the getDataMember function in my class to
the appropriate recordset. In the VB form I've placed a DataGrid and
assigned it's dataSource to an instance of the above mentioned class. So
far it works fine.
When the data in the grid is updated with its new data, I want to
capture the conflicting records by using the adFilterConflictingRecords
property.
Here is some info regarding the recordset in the dataSource class.
The driver used here is "SQLOLDEDB" and I have an ADO Static recordset
with a Client Side cursor and the locking option set to
adLockBatchOptimistic.

Problem:

After running the program and made sure that the DataGrid in the form is
displaying the data form SQL Server I used the SQL Analyser to alter one
or two same records so that ADO can capture the conflicting records in
the VB program by filtering conflicting records.
When the Data in the Gird is updated, ADO raises the follwoing error

Run-time error: -2147217864 (80040e38):
The specified row could not be located for updating. Some values may
have been changed since it was last read.

Here is a strange behaviour of ADO.  This setting works fine (ADO
filters the correct amount of records that are conflicting)if the
recordset is created directly in the form itself. But does not filter
conflicting records when the recordset is used from an instance of a
datasource class where the DataSourceBehaviour property is set to 1. The
record count is always equal to the original recordset's record count
even after filtering the conflicting records.

I am pretty sure that my coding is correct. I may have made a mistake
somewhere or it may be a bug in ADO. Any help is appreciated. Thank you.

Anand.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!



Sun, 01 Aug 2004 13:21:35 GMT  
 ADO Recordset's strange behaviour when filtered using adFilterConflictingRecords
Hi Anand,
Thanks for posting this question.
I have done enough research on this because of you and  still feeling
lot to be known in this direction -:)

If you set the Filter property on a Recordset to an array of bookmarks
or to a value in FilterGroupEnum other than adFilterNone, the DataGrid
control will  display all the records in the Recordset.

If you use adFilterConflictingRecords, RecordCount property will return
either a positive number indicating the number of records whose updates
failed as a result of conflicts, or 0 if no conflicts occurred.
An update that failed as a result of a referential integrity violation
or other database constraint will not be visible through this filter
because such failures are not seen as conflicts.

Harinatha Reddy Gorla (MCSD)
        Software Engineer
Smart Software Technologies,
Hyderabad, India

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!



Sun, 01 Aug 2004 15:17:40 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. ADODB.recordset filter problem using 'AND'

2. Filtering ADO Recordset on Date Field using NON-US Locale

3. ADO recordset filter using wildcards - results in error 3001

4. ADO bound Datalist strange behaviour?

5. Help : Strange VFP ODBC/ADO behaviour

6. Strange Behaviour VB6 ADO MSACCESS Added Records do not appear immediately

7. Xtract a recordset from an existing recordset w/out using Filter

8. unsetting a recordset '.FILTER'

9. ADO or DataEnvironment COMMAND Using Store procedure can't return recordset

10. Can't reset commandtext for recordset in dataenvironment using ADo

11. ADO or DataEnvironment COMMAND Using Store procedure can't return recordset

12. Using VB 4.0 with DBF's, CDX's and Setting a Filter

 

 
Powered by phpBB® Forum Software