Problem in know number of records

Forum related to SQLite

Moderators: gto, cipto_kh, EgonHugeist

Novato
Fresh Boarder
Fresh Boarder
Posts: 1
Joined: 20.12.2016, 11:24

Problem in know number of records

Postby Novato » 20.12.2016, 11:50

"I've got an Sqlite3 table with a lot of records and I want to know exactly how many there are.
I have tried:
Query.Sql.text := "Select * From Tabla";
Query.Last;
Nro := Query.recordcount;
This gives an error message saying that it cannot load all of the records in the memory.
I've also tried:
Query.Sql.Text := "Select count(*) from tabla";
Nro := SQL.recordcount;
The value of Nro is 1.
How can I get the number of records?."





Juan Perles
628.482.007
Enviado desde mi iPad

marsupilami
Gold Boarder
Gold Boarder
Posts: 673
Joined: 17.01.2011, 14:17

Re: Problem in know number of records

Postby marsupilami » 20.12.2016, 18:24

Hello Juan,

try this:

Code: Select all

Query.Sql.Text := "Select count(*) from tabla";
Query.Open;
Nro := Query.Fields[0].AsInteger;


With best regards,

Jan


Return to “SQLite”

Who is online

Users browsing this forum: No registered users and 0 guests