Filter the Recordset Object

Filter the Recordset Object


Does using the recordset.filter variable slow down response time greatly? For example:

rsObj.filter = "sCat = 1"

I am using it to filter my recordset object so that I can fill specific drop-downs with data. But it seems to be very slow when used against a SQL Server database. However, it works fine with a local Access file.


Yes. Instead of using the Filter method, try to modify the SQL statement of your recordset so that it brings back only the records you need. In your example, include a where clause of the type “WHERE sCat = 1”. This will be much faster than trying to bring in all the records from your database to your ASP page and then having the ASP page’s recordset variable filter the data.


Share the Post: