I have got a recordset with multiple entries in it, I want to be able to display a specific record range from this recordset (say records 5 - 10) I don't really know where to start with this at the moment being fairly new to ASP, any ideas ??
if u know the specific record's any one fields value for example if one of ur field name is emp_name and u want the employee with name "arperry".
if u want to cull out the particular record from the table means u can directly use the sql query for that.
like this
set myconn=server.CreateObject("adodb.connection"
myconn.Open dsn
set rs=server.CreateObject("adodb.recordset"
sql="select * from employee where emp_name='arperry'"
rs.Open sql,myconn
so that u can directly get ur specific record from ur table.
if this is not suitable for ur job means try this
set myconn=server.CreateObject("adodb.connection"
myconn.Open dsn
set rs=server.CreateObject("adodb.recordset"
sql="select * from employee"
rs.Open sql,myconn
while not rs.EOF
if rs("emp_name"="arperry' then
' print ur record
'do ur process
end if
rs.MoveNext
wend
i hope this will help u to solve ur problem
webspy
maybe i should have been more specific. what i want to do is to have a load of records that i can then jump through 10 at a time, at the click of a button, allowing me to move through the records in a controlled manor, as i only want to display a few recirds on a page.
so i can do something like:
i=0
end =5
while not rs.eof
response.write rs("name"(i)
i=i+1
if i >= end then
exit while
end if
rs.movenext
wend
where i is the recordcounter for the records that i want to display, and end is the final record i want to display this time around
allowing me to display the five or whatever records to the screen. can this be done in this manor, or do i have to look at another way of doing this. any suggestions ?
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.