||Re: SQLSelect, RecCount() and SQL_XPP_ERROR
Boris Borzic <bb> <Boris Borzic <bb>>
||Thu, 30 Aug 2018 23:08:22 +0200
Raimundo Alba <> wrote in news:dne26o6ouoqw6qb.300820181120@daz17:
> I'm rewritting an old piece of code involving error control made by
> other guy many years ago and would like to ask a question about.
> Whenever a connection is opened and a SQLSelect is done there is a
> check for SQL_XPP_ERROR state but also there is a routine checking
> RecCount() result value not being "-1".
> Now I'm seeing as SQLExpress documentation shows that this result in a
> "SELECT COUNT(*) FROM..." statement being executed too and this is
> overheating the system.
> My question is that if really needed this second control for errors or
> if there is any other more lightweight of doing it, maybe and eof()
No, you definitely don't need this when using SQLSelect because it will
result in an additional "select count(*)..." being executed.
Replace the :RecCount with a check for :eof()
Note that the above does not apply to SQLDataSet. There is no penalty for
calling reccount on a SQLDataSet object.
industrial strength Xbase++ development tools