Hi Kmar,
the error is in your open
rsMaster.open "select categoryid, sortorder from categories order by sortorder asc", dbConnection, 2, 3
try this
rsMaster.open "select categoryid, sortorder from categories order by sortorder asc", dbConnection, 1,1
that should do the trick for you.
Paul