Alternative to CDaoRecordset::MoveLast ?? 
Author Message
 Alternative to CDaoRecordset::MoveLast ??

I need to do a CDaoRecordset::MoveLast after a query to count the number of
record returned. It is also
needed for my Virtual CListCtrl to work. If i don't do it the number or
record returned is 1 and my listView only show 1 record.

But this is very slow ! It can easily take 30-40 seconds for a 360 000 entry
database. All i want to know is the number of record the query returned and
also be able to access all of them with my Virtual CListCtrl without doing
this MoveLast command.

Now that i know it is the problem, can i replace it with something else ?

--
--

Sylvain Simard
Analyste-Programmeur
Dveloppement multimdia
QA International

http://www.*-*-*.com/
http://www.*-*-*.com/
http://www.*-*-*.com/



Sun, 17 Aug 2003 05:15:33 GMT  
 Alternative to CDaoRecordset::MoveLast ??
Can't you do a "SELECT COUNT(MYID) as MyCount FROM MyTableOrQuery"? That should return the record count. If that is too slow you
might consider making a new table that holds the count of the number of records in that Query and update that when records are added
and deleted. That lookup will extremly quick.

_______________________________
Craig Klementowski
Web:   www.mediaright.com
_______________________________

Quote:

> I need to do a CDaoRecordset::MoveLast after a query to count the number of
> record returned. It is also
> needed for my Virtual CListCtrl to work. If i don't do it the number or
> record returned is 1 and my listView only show 1 record.

> But this is very slow ! It can easily take 30-40 seconds for a 360 000 entry
> database. All i want to know is the number of record the query returned and
> also be able to access all of them with my Virtual CListCtrl without doing
> this MoveLast command.

> Now that i know it is the problem, can i replace it with something else ?

> --
> --

> Sylvain Simard
> Analyste-Programmeur
> Dveloppement multimdia
> QA International

> http://www.quebec-amerique.com
> http://www.qa-international.com
> http://www.qadigital.com/



Sun, 17 Aug 2003 08:03:06 GMT  
 Alternative to CDaoRecordset::MoveLast ??
Select count should work fine, i just don't know if ti will allow my Virtual
ListCtrl to work fine... but thanks, i'll check this out today and post my
results.


Quote:
> Can't you do a "SELECT COUNT(MYID) as MyCount FROM MyTableOrQuery"? That

should return the record count. If that is too slow you
Quote:
> might consider making a new table that holds the count of the number of

records in that Query and update that when records are added
Quote:
> and deleted. That lookup will extremly quick.

> _______________________________
> Craig Klementowski
> Web:   www.mediaright.com
> _______________________________



Quote:
> > I need to do a CDaoRecordset::MoveLast after a query to count the number
of
> > record returned. It is also
> > needed for my Virtual CListCtrl to work. If i don't do it the number or
> > record returned is 1 and my listView only show 1 record.

> > But this is very slow ! It can easily take 30-40 seconds for a 360 000
entry
> > database. All i want to know is the number of record the query returned
and
> > also be able to access all of them with my Virtual CListCtrl without
doing
> > this MoveLast command.

> > Now that i know it is the problem, can i replace it with something else
?

> > --
> > --

> > Sylvain Simard
> > Analyste-Programmeur
> > Dveloppement multimdia
> > QA International

> > http://www.quebec-amerique.com
> > http://www.qa-international.com
> > http://www.qadigital.com/



Sun, 17 Aug 2003 22:29:39 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Alternative to CDaoRecordset::MoveLast

2. CDaoRecordSet -- CDaoRecordSet -- CDaoRecordSet

3. ODBC SQLExtendedFetch MoveLast, but fast

4. MovePrev() and MoveLast() give DB_E_BADSTARTPOSITION

5. MoveFirst, MoveNext, MoveLast, MovePrevious ?

6. alternative NET framework

7. alternative to #import <msxml2.dll>

8. Alternative C++ file extensions (.cc in particular)

9. Alternative to STRTOK In tokenizing

10. Sending a multipart/alternative email in C#

11. style? OO alternatives

12. Alternatives to Standard I/O

 

 
Powered by phpBB® Forum Software