You need to give more information !
Try this request:
Cursor1 = SQL1.ExecQuery("SELECT * FROM YouTable"
Log(Cursor1.RowCount)
What value do you get ?
Are all rows of the id column filled ?
If in max(id) id is an INTEGER PRIMARY KEY, be aware that max(id) will return the max value which is not always equal to the number of rows.
With INTEGER PRIMARY KEY, if you remove a row the id values remain the same.
This means that the max value doesn't change but the number of rows is minus 1.