Q: Seek a record while not change recordset
Yong Xu -- yongxu@myself.com Thursday, January 30, 1997 Environment: VC++ 4.2-flat, Win95 Hi there, First of all, I can't help but thank these gentlemen: Dong Chen Mike B. Roger Onslow(I learned from your posts though they did not respond to my question) Klaus G. H. Mike Hu Robert Yang && David Elliot I am using ODBC. I want to seek a record in a record set and if seeking succeeded, make the record current record, just like what CDaoRecordset::Seek() does. I can not call CRecordset::Requery() because I want to keep the record set unchanged and let user moves among records in it. Can I achieve that? If yes, how should I do? I do not have MSDN. TIA. -- Cordial, Yong Xu, yongxu@myself.com, Hangzhou, P.R.C
Dip. Ing. Fabio Saponaro - C.S.G. -- fabio@csg.it Monday, February 03, 1997 At 19.39 30/01/97 +0800, you wrote: >Environment: VC++ 4.2-flat, Win95 > >Hi there, > >First of all, I can't help but thank these gentlemen: >Dong Chen >Mike B. >Roger Onslow(I learned from your posts though they did not respond to my >question) >Klaus G. >H. Mike Hu >Robert Yang >&& >David Elliot > >I am using ODBC. I want to seek a record in a record set and if seeking >succeeded, make the record current record, just like what >CDaoRecordset::Seek() does. I can not call CRecordset::Requery() because >I want to keep the record set unchanged and let user moves among records >in it. Can I achieve that? If yes, how should I do? > >I do not have MSDN. > >TIA. > >-- >Cordial, Yong Xu, yongxu@myself.com, Hangzhou, P.R.C > > > You can use CDaoRecordset::MoveFirst to move to the first record in your recordset and next use CDaoRecordset::FindFirst ( LPCTSTR lpszFilter ) where lpszFilter is string expression (like the WHERE clause in an SQL statement without the word WHERE) used to locate the record. Don't forget to test if you find more that one record in your recordset, that satisfy 'lpszFilter'. Hope this help you ! Bye Fabio
| Вернуться в корень Архива |