Removed superseded code

Now using SQL query to get maximum row number, so no longer have to
count the rows