hello there !

This code demonstrate how to make next and previous image links of a current image
Code:
<%

Category =request.QueryString("cat_id")
 thisid=request.QueryString("id")
mysql= "select * from view_image 
where  cat_id="&Category 

set rs= ado.execute(mysql) 


   
	dim a(2)
	a(1)=rs("img_id")
	a(2)=rs("img_id")%>
	<%
	             
     do until rs.eof
     
	if a(1)=int(thisid) then
	%>
<IMG src="img\<% =rs("path") %>">

<%
    rs.movenext
	  	if  not rs.EOF then%>
<a href="view.asp?id=<%=rs("img_id")%>
&cat_id=<%=rs("Cat _id")%>">

<img border="0" src="img/next.gif"></a>

	<%end if
		
	Exit Do
	
   end if
   
 		rs.movenext
 		a(1)=rs("image_id")
   loop
   
   rs.moveprevious
	%>
	
	<% rs.moveprevious 
	if not rs.BOF then
	%>
<a href="view.asp?id=<%=rs("img_id")%>
&cat_id=<%=rs("Cat_id")%>">
<img border="0" src="img/previous.gif"></a>
		<% end if %>
rs.moveprevious will not work unless you write this code before open connection

Code:
conn.CursorLocation = 3