If your are using RDC you could filter the cleint side recordset, you could also do the same thing with an XML dataset, but if you are using plain old ado, and server side recordsets, it is called a WHERE clause in your select statement. If you are bringing back an entire table, but only displaying x records you are causing huge performance problmems.
You can use the Filter property of your Recordset Object, wich in my opinion is more eficinet then creat another recordset for every option you filter.
set rs=Server.CreateObject("ADODB.Recordset"
rs.CursorType = adOpenStatic
rs.CursorLocation = adUseClient
rs.LockType = adLockPessimistic
rs.Source = "select * from myTable"
rs.ActiveConnection = conn
rs.Open
...
'filtering after age=25 lets say
rs.Filter="age=25"
'now you have other properties for the rs Object
'like new RecordCount and Bof, Eof values
while not rs.EOF
'do your job
rs.MoveNext
wend
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.