E enonod Well-Known Member Licensed User Longtime User Oct 13, 2007 #1 To keep control of records I am using... lLastRec=gPage*gRows ...and then SQL statement... SELECT * FROM Titles WHERE ROWID >0 AND ROWID <= lLastRec ORDER BY num The SQL error 'No such column lLastRec' suggests a variable cannot be used to compare ROWID. Having replaced it with a number and it works seems to confirm this. This obviously presents a problem when trying to obtain sets of data to display one page at a time to avoid having scrollbars appear on the Table. It means a number must manually be provided per page. I must have something wrong here.
To keep control of records I am using... lLastRec=gPage*gRows ...and then SQL statement... SELECT * FROM Titles WHERE ROWID >0 AND ROWID <= lLastRec ORDER BY num The SQL error 'No such column lLastRec' suggests a variable cannot be used to compare ROWID. Having replaced it with a number and it works seems to confirm this. This obviously presents a problem when trying to obtain sets of data to display one page at a time to avoid having scrollbars appear on the Table. It means a number must manually be provided per page. I must have something wrong here.
Erel B4X founder Staff member Licensed User Longtime User Oct 13, 2007 #2 There should be no problem using a variable, but you need to use the concatenation operator: Cmd.CommandText = " SELECT * FROM Titles WHERE ROWID >0 AND ROWID <= " & ILastRec & " ORDER BY num"
There should be no problem using a variable, but you need to use the concatenation operator: Cmd.CommandText = " SELECT * FROM Titles WHERE ROWID >0 AND ROWID <= " & ILastRec & " ORDER BY num"