Hello,
While there is no problem with this in Firebird server, items such as oResult.first() & oResult.last() are not being handled in Firebird embedded driver. Should be reported as a bug.
Suggestion. Run a separate query first (using same conditions) with Count(x). Result set will provide number of records.
FYI - Setting parameters in a prepared statement doesn’t work either.
Edit 2018-12-11:
Have run across this → Comment #2 in Bug #118094 and after limited testing appears to work in both Firebird server & Firebird embedded. Tests included First, Last, previous(), Row, RowCount, updateString(x, "xxx") and updateRow(). Again note there was limited testing done.
Also, the code worked from the IDE but modified:
oRS.DataSourceName = ThisComponent.Location
to:
oRS.DataSourceName = ThisComponent.Parent.Location
for it to work from a form.