Using tUniquery
Posted: Sun 17 Jan 2016 12:05
I'm trying to use the same tUniQuery object to get number of records after selecting a filter fields and later to retrieve all records in a dataset.
This would be the code to retrieve the number of records:
Later try to use the same object (uQPisos) to retrieve all the fields and show them into a grid.
As you can see in the first case I use a single key field for the recovery of the total number of records trying be as fast as possible (select nCodInm from ...).
In the second case I need all fields to show (select * from ...)
The problem is that the query is not updated when I try to retrieve all fields and I get a single field (nCodInm).
I can use two differents tUniQuery objects for resolve it but I don't think that be a good solution.
Anyone can tell me why this happens and what would be the right way to do it ??
Thank you
This would be the code to retrieve the number of records:
Code: Select all
cStr: = 'select nCodInm from' + form1.cDataBaseName + '. Dbo.Vista_pisos Where NhaB> =' + int (tbHabit.Value) .ToString;
uQPisos.Close;
uQPisos.SQL.Text: = cStr; uQPisos.Open;
lbNumReg.Text: = 'Total Pisos: = uQPisos.RecordCount. ToString;Code: Select all
cStr: = 'SELECT * FROM' + form1.cDataBaseName + '. dbo.Vista_pisos Where NhaB> =' + int (tbHabit.Value) .ToString;
uQPisos.Close;
uQpisos.SQL.Text: = cStr;
ClientModule1.uQPisos.Open;In the second case I need all fields to show (select * from ...)
The problem is that the query is not updated when I try to retrieve all fields and I get a single field (nCodInm).
I can use two differents tUniQuery objects for resolve it but I don't think that be a good solution.
Anyone can tell me why this happens and what would be the right way to do it ??
Thank you