I can't say why it works in one cart and not the other.
The reason the error is occurring, is because the code to set the countyid session variable is before the code that creates the recordset, move the code to create the session so that it is after the code to create the recordset.