Forum > Databases

Query Sqlite3 Question

(1/2) > >>

So since Query.Recordcount will only return 10 records as a count at a time, how can I determine the actual amount of records within a sqlite3 database? is there some other var?

You can execute an sql similar to you own with COUNT(1) instead of your fields.
Do like SELECT COUNT(*) AS number_of_records FROM orders;

You can also do a SqlQuery1.Last and SqlQuery1.First after opening your SqlQuery1. After that you .RecordCount will contain the actual correct recordcount. This will give you a slight performance hit depening on the number of records.

Property PackedRecord is always 10. Set it to 0 and al records will be fetched.

Offcourse the option from rvk wil work.

Addition to rvk:
If you set PacketRecords to -1 you load all records (and don't need to move to Last/First).
The penalty on performance is still there.
So i agree with RVK: Fire a SELECT COUNT is probably the best way

Why do you need the Query.RecordCount ? This is the basic question.


[0] Message Index

[#] Next page

Go to full version