It is possible to trouble with compact disks.RecordCount ?

It's my job to utilize it to find out basically have records inside a query.

But speaking having a college he told that there's a performance penalty to that particular!

I've made some make sure nothing major emerged.

So it is possible to performance penalty or other trouble with RecordCount?!

If that's the case, what's the easiest method to see if you will find some records inside a query?


If you are using TClientDataSet (as the 'cds' appears to imply) with PacketRecords set to -1 (default) or FetchOnDemand set to False there's no difference because the client dataset receives and loads all data into memory at the same time. The main difference could be noteworthy along with other datasets which fetch data when needed while you advance the cursor, using RecordCount would fetch all data first. In such instances it's easier to make use of the dataset's EOF property after opening - if all you'd like to learn is whether or not the end result set was empty or otherwise.

The very best solution is always to perform SELECT COUNT(*) query.

If you want all records in your area, you need to set the FetchOnDemand property to False or call cds.Last before cds.RecordCount.

There's additionally a cds.IsEmpty method when the purpose would be to check if the dataset consists of records...