Board index » delphi » Access. D4 reporting incorrect record count

Access. D4 reporting incorrect record count

Hello,

Using D4 and Access 97 with a VERY large table (500,000+ records - yeah I
know), the .RecordCount property returns 7509 records not 509211.   How do I
get the correct number?

var
    RecCt : LongInt;

begin
    RecCt := Table1.RecordCount;    {Wrong number of records}
    ...

Any help is greatly appreciated!

Thanks,
Craig

 

Re:Access. D4 reporting incorrect record count


Jeff,

Thanks for the response, and perhaps I'm being extra dumb, but nothing
changed.  Here's the actual code:

   TbVoters.Active := True;
   TbVoters.FetchAll;    {Just added}
   StatusBar.Panels[0].Text := 'Version: '+VersionConst;
   StatusBar.Panels[1].Text := FormatDateTime('DDDD, MMMM D, YYYY',now);
   StatusBar.Panels[2].Text := 'Records: '+IntToStr(TbVoters.RecordCount);
    {TbVoters.RecordCount still rerturns incorrect number}

Craig

Jeff Overcash (TeamB) <overc...@onramp.net> wrote in message
news:3796996E.D6D43218@onramp.net...

Quote
> RecordCount will not be correct until at least a FetchAll is called and
all the
> records are returned to the client side.

> Craig Andrews wrote:

> > Hello,

> > Using D4 and Access 97 with a VERY large table (500,000+ records - yeah
I
> > know), the .RecordCount property returns 7509 records not 509211.   How
do I
> > get the correct number?

> > var
> >     RecCt : LongInt;

> > begin
> >     RecCt := Table1.RecordCount;    {Wrong number of records}
> >     ...

> > Any help is greatly appreciated!

> > Thanks,
> > Craig

> --
> Jeff Overcash (TeamB)
>       (Please do not email me directly unless  asked. Thank You)
> And so I patrol in the valley of the shadow of the tricolor
> I must fear evil. For I am but mortal and mortals can only die.
> Asking questions, pleading answers from the nameless
> faceless watchers that stalk the carpetted  corridors of Whitehall.
>              (Fish)
> --

Re:Access. D4 reporting incorrect record count


RecordCount will not be correct until at least a FetchAll is called and all the
records are returned to the client side.

Quote
Craig Andrews wrote:

> Hello,

> Using D4 and Access 97 with a VERY large table (500,000+ records - yeah I
> know), the .RecordCount property returns 7509 records not 509211.   How do I
> get the correct number?

> var
>     RecCt : LongInt;

> begin
>     RecCt := Table1.RecordCount;    {Wrong number of records}
>     ...

> Any help is greatly appreciated!

> Thanks,
> Craig

--
Jeff Overcash (TeamB)
      (Please do not email me directly unless  asked. Thank You)
And so I patrol in the valley of the shadow of the tricolor
I must fear evil. For I am but mortal and mortals can only die.
Asking questions, pleading answers from the nameless
faceless watchers that stalk the carpetted  corridors of Whitehall.
             (Fish)
--

Re:Access. D4 reporting incorrect record count


My Recordset  Components have a property

property AutoFillUprecordset: Boolean

that will automatically fill the recordset to ensure to return the correct
record count

www.gm-software.de

Re:Access. D4 reporting incorrect record count


Try going to the last record then back to the first. See if that makes any
difference. Sometimes I have found that this puts the record count in sync
for large tables that can't load entirely at one time.

    TbVoters.Last;
    TbVoters.First;

Woody

Quote
Craig Andrews <Cr...@ZDTSoftware.com> wrote in message

news:7n683c$laa16@forums.borland.com...
Jeff,

Thanks for the response, and perhaps I'm being extra dumb, but nothing
changed.  Here's the actual code:

   TbVoters.Active := True;
   TbVoters.FetchAll;    {Just added}
   StatusBar.Panels[0].Text := 'Version: '+VersionConst;
   StatusBar.Panels[1].Text := FormatDateTime('DDDD, MMMM D, YYYY',now);
   StatusBar.Panels[2].Text := 'Records: '+IntToStr(TbVoters.RecordCount);
    {TbVoters.RecordCount still rerturns incorrect number}

Craig

Jeff Overcash (TeamB) <overc...@onramp.net> wrote in message
news:3796996E.D6D43218@onramp.net...

Quote
> RecordCount will not be correct until at least a FetchAll is called and
all the
> records are returned to the client side.

> Craig Andrews wrote:

> > Hello,

> > Using D4 and Access 97 with a VERY large table (500,000+ records - yeah
I
> > know), the .RecordCount property returns 7509 records not 509211.   How
do I
> > get the correct number?

> > var
> >     RecCt : LongInt;

> > begin
> >     RecCt := Table1.RecordCount;    {Wrong number of records}
> >     ...

> > Any help is greatly appreciated!

> > Thanks,
> > Craig

> --
> Jeff Overcash (TeamB)
>       (Please do not email me directly unless  asked. Thank You)
> And so I patrol in the valley of the shadow of the tricolor
> I must fear evil. For I am but mortal and mortals can only die.
> Asking questions, pleading answers from the nameless
> faceless watchers that stalk the carpetted  corridors of Whitehall.
>              (Fish)
> --

Re:Access. D4 reporting incorrect record count


Thanks to everyone, but the blasted thing still says there are only 7509
records.  This wouldn't be all that important but during an iteration
through the database, I use progressbar.position := ((current_record_ctr /
tbvoter.recordcount) * 100).

Craig

Quote
Woody <woody....@ih2000.net> wrote in message

news:932653250.681.50@news.remarQ.com...
Quote
> Try going to the last record then back to the first. See if that makes any
> difference. Sometimes I have found that this puts the record count in sync
> for large tables that can't load entirely at one time.

>     TbVoters.Last;
>     TbVoters.First;

> Woody

> Craig Andrews <Cr...@ZDTSoftware.com> wrote in message
> news:7n683c$laa16@forums.borland.com...
> Jeff,

> Thanks for the response, and perhaps I'm being extra dumb, but nothing
> changed.  Here's the actual code:

>    TbVoters.Active := True;
>    TbVoters.FetchAll;    {Just added}
>    StatusBar.Panels[0].Text := 'Version: '+VersionConst;
>    StatusBar.Panels[1].Text := FormatDateTime('DDDD, MMMM D, YYYY',now);
>    StatusBar.Panels[2].Text := 'Records: '+IntToStr(TbVoters.RecordCount);
>     {TbVoters.RecordCount still rerturns incorrect number}

> Craig

> Jeff Overcash (TeamB) <overc...@onramp.net> wrote in message
> news:3796996E.D6D43218@onramp.net...
> > RecordCount will not be correct until at least a FetchAll is called and
> all the
> > records are returned to the client side.

> > Craig Andrews wrote:

> > > Hello,

> > > Using D4 and Access 97 with a VERY large table (500,000+ records -
yeah
> I
> > > know), the .RecordCount property returns 7509 records not 509211.
How
> do I
> > > get the correct number?

> > > var
> > >     RecCt : LongInt;

> > > begin
> > >     RecCt := Table1.RecordCount;    {Wrong number of records}
> > >     ...

> > > Any help is greatly appreciated!

> > > Thanks,
> > > Craig

> > --
> > Jeff Overcash (TeamB)
> >       (Please do not email me directly unless  asked. Thank You)
> > And so I patrol in the valley of the shadow of the tricolor
> > I must fear evil. For I am but mortal and mortals can only die.
> > Asking questions, pleading answers from the nameless
> > faceless watchers that stalk the carpetted  corridors of Whitehall.
> >              (Fish)
> > --

Other Threads