CRecordset bulk read problem 
Author Message
 CRecordset bulk read problem

Environment:
Windows XP Sp1
Visual C++ 6.0
MS SQL Server 2000
ODBC

Problem:
I have derived a recordset class from CRecordset,
and is using bulk row fetching. The data from the
database is fetched in batches of 25 rows (default
recordset size). If I terminate the operation when
x rows are handled, the remaining (25-x) rows will
turn up in the first batch when I restart the operation.
All is well so far, but the first batch will hold
x rows of invalid information, too. The next 25 rows
fetched will be valid again.

I have implemented the communication with the database in
a separate thread. When the operation is stopped, the
thread
is deleted along with the recordset and the database
connection
(CDatabase). The problem only arises when I recreate the
thread without terminating the application. I have traced
my
application to ensure that all recordsets and database
connections are destroyed when I delete the thread.

Example:
Operation started
Database connection established
Recordset opened
25 rows fetched
13 rows handled
Operation stopped
The recordset is closed
The database connection is closed

Operation restarted
The database connection is established
The recordset is opened
25 rows are fetched (verified by a call to
CRecordset::GetRowsFetched)
12 rows hold valid information
13 rows hold invalid information
25 rows are fetched
All 25 rows hold valid information

Kind regards

Kjell-?ke Boberg



Sat, 24 Dec 2005 21:39:15 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. CRecordset bulk row fetch broken?

2. CRecordSet in Bulk mode how to Add,Delete,Update

3. Leaky CRecordset::Bulk RFX help?

4. ODBC CRecordSet Bulk Fetching

5. CRecordset Bulk Row Fetching

6. Using Bulk record fetching with CRecordset

7. CRecordset Bulk Field Exchange

8. CRecordSet in Bulk mode how to Add,Delete,Update

9. Problem: CRecordset::dynaset is Read only

10. Problem writing to two database tables that are joined ( CRecordSet read-only)

11. Reading strings in bulk

12. Problem writing to two database tables that are joined ( CRecordSet read-only)

 

 
Powered by phpBB® Forum Software