Problem with find a record using DAO 
Author Message
 Problem with find a record using DAO

Hi,
I have a problem using CDaoRecordset::FindFirst() to search for a specific
record. I had it work fine if there is a match record. But if there is'n a
match record, I'll get an error "No current record" when I try to do
anything else. I thought I could use IsEOF() but it did not work. May be I
did it wrong. Please help! Thanks.

Tiencuong.



Fri, 03 May 2002 03:00:00 GMT  
 Problem with find a record using DAO
I would do this:

COleVariant tempOle;

tempOle=recordset.GetBookmark();

if(!recordset.FindFirst(whatever))
{
AfxMessageBox("tell user");
recordset.SetBookmark(tempOle);       // If you care where it is or
recordset.MoveFirst();                            // If you don't  care

Quote:
}

Keith
Quote:

>Hi,
>I have a problem using CDaoRecordset::FindFirst() to search for a specific
>record. I had it work fine if there is a match record. But if there is'n a
>match record, I'll get an error "No current record" when I try to do
>anything else. I thought I could use IsEOF() but it did not work. May be I
>did it wrong. Please help! Thanks.

>Tiencuong.



Fri, 03 May 2002 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Problem adding record to blank Access Table using DAO

2. Problem finding first record using CDaoRecordset class

3. Problem finding first record using CDaoRecordset

4. DAO: find and copy a records data to a struct

5. Adding records to a MDB file using DAO

6. Can't add new record using MFC DAO

7. DAO & Indexes - Adding records/Current record

8. Utility to find out modified record using Checksum algorithm

9. Finding records using CRecordset

10. Finding last record added using ODBC

11. Using DAO Seek to find NULL values

12. Problem using Requery() using DAO

 

 
Powered by phpBB® Forum Software