hi...I'm trying to do an image gallery with next and previous links. The way I'm doing it is I'm comparing my querystring to my primary ID in my database...so for example...default.asp?rec=1 I tell it to get all the images whose primaryID is larger than the querystring. it's been awhile since I've done ASP. Can I compare autonumbers to numbers??? I'm getting an error for that. here is my code.
Really appreciate it. Thanks. Also how do I pass a value when Default.asp is my start page??? Thanks again.
<%
dim rsImage
dim sql
dim counter
dim limit
sql = "select Top 8 * from tblImages where image_ID > '" & Request.QueryString("rec" & "'"
set rsImage = Server.CreateObject("Adodb.recordset"
rsImage.Open sql, objConn, adOpenDynamic, adLockReadOnly, adcmdText
limit = 5
counter = 1
do while not rsImage.EOF
if counter = 1 then
Response.Write "<tr>"
end if%>
<td><a href="<%=rsImage("image_large"%>" target="_blank"><img src="<%=rsImage("image_small"%>" style="filter:alpha(opacity=50)" onmouseover="nereidFade(this,100,30,5)" onmouseout="nereidFade(this,50,50,5)"></a>
</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<%counter = counter + 1
if counter = limit then
Response.Write "</tr>"
counter = 1
end if
rsImage.MoveNext
loop
%>
<tr>
<td></td>
<td height="20"></td>
</tr>
<tr><td><a href="Default.asp?rec=<%=Request.QueryString("rec"%>">next</a></td></tr>
</table>
Really appreciate it. Thanks. Also how do I pass a value when Default.asp is my start page??? Thanks again.
<%
dim rsImage
dim sql
dim counter
dim limit
sql = "select Top 8 * from tblImages where image_ID > '" & Request.QueryString("rec" & "'"
set rsImage = Server.CreateObject("Adodb.recordset"
rsImage.Open sql, objConn, adOpenDynamic, adLockReadOnly, adcmdText
limit = 5
counter = 1
do while not rsImage.EOF
if counter = 1 then
Response.Write "<tr>"
end if%>
<td><a href="<%=rsImage("image_large"%>" target="_blank"><img src="<%=rsImage("image_small"%>" style="filter:alpha(opacity=50)" onmouseover="nereidFade(this,100,30,5)" onmouseout="nereidFade(this,50,50,5)"></a>
</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<%counter = counter + 1
if counter = limit then
Response.Write "</tr>"
counter = 1
end if
rsImage.MoveNext
loop
%>
<tr>
<td></td>
<td height="20"></td>
</tr>
<tr><td><a href="Default.asp?rec=<%=Request.QueryString("rec"%>">next</a></td></tr>
</table>