🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.delphi.database
Article #181

Delphi BDE Table problem with recordcount.

#181
From: Andy Butler
Date: Wed, 11 Mar 2009 21:43
31 lines
2301 bytes
Hi,
hope it is appropriate to ask here.

I have a database application which I wrote for a client and is now behaving strangely.

Delphi 2006, paradox database, BDE.

I have a table which I check for RecordCount before performing a number of functions.

MyTable.RecordCount is sometimes returning a value of one less than the actual number of records.

I tried using a Query, SELECT COUNT(*) FROM MyTable  , and this produces the same result.

MyTable is the detail in a detail-master relationship, and as I scroll through the main table most
of the time RecordCount comes out correct, just that for a few of the Master table records, the corresponding
RecordCount in the detail is incorrect.

Weirdly, this is code that worked perfectly for years.

So, obviously I'm looking for some kind of quick fix, as this problem is making the 
software unusable for the client.
Most worrying thing is that I use RecordCount throughout the application, if this
becomes a problem with other Tables I'm looking at an absolute nightmare.

I understand that I may be able to use BOF and EOF as an alternative way of checking
for an empty table, and iterating through each record, trouble is, it will take
weeks to go through every instance of Recordcount in all my software.

thank you for any hints

andy butler 
Technical Details
Message-ID: <49b82e63$1_2@mk-nntp-2.news.uk.tiscali.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!nx02.iad.newshosting.com!newshosting.com!tiscali!newsfeed2.ip.tiscali.net!212.74.112.120.MISMATCH!mk-nntp-1.news.uk.tiscali.com!mk-nntp-2.news.uk.tiscali.com

Show Full Headers
Complete Article Headers
X-Google-Thread: 115d96,9f817a42b67c0dff,start
X-Google-Attributes: gid115d96,domainid0,public,usenet
X-Google-Language: ENGLISH,ASCII-7-bit
Date: Wed, 11 Mar 2009 21:43:12 +0000
From: Andy Butler <akbutler@tiscali.co.uk>
User-Agent: Thunderbird 1.5.0.9 (Windows/20061207)
MIME-Version: 1.0
Newsgroups: borland.public.delphi.database
Subject: Delphi BDE Table problem with recordcount.
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Message-ID: <49b82e63$1_2@mk-nntp-2.news.uk.tiscali.com>
Lines: 31
X-Original-NNTP-Posting-Host: 79.78.215.194
NNTP-Posting-Host: mk-nntp-2.news.uk.tiscali.com
X-Trace: 11 Mar 2009 21:34:30 GMT, mk-nntp-2.news.uk.tiscali.com
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!nx02.iad.newshosting.com!newshosting.com!tiscali!newsfeed2.ip.tiscali.net!212.74.112.120.MISMATCH!mk-nntp-1.news.uk.tiscali.com!mk-nntp-2.news.uk.tiscali.com