The Forum has been Updated
        The code has been upgraded to the latest .NET core version. Please check instructions in the Community Announcements about migrating your account.
    
                        Here's a bit of code from another project.  The bit from (While) to (Wend) causes the page to stop responding but dratted if I can figure out why.  What it's SUPPOSED to do there is check whether the new images belong to the previous listing ID and, if so, skip them until a new listing ID shows up.
                            
                    
                Code:
strSqlQ = "SELECT L.PHOTO_URL, L.LISTING_ID, L.TOPIC_ID, T.T_STATUS, T.T_SUBJECT FROM LISTING_PHOTOS L, " & strTablePrefix & "TOPICS T WHERE ((T.T_STATUS=1) AND (T.TOPIC_ID=L.TOPIC_ID)) ORDER BY LISTING_ID DESC, PHOTO_PRIORITY ASC"
Set rsDisplay = Server.CreateObject("ADODB.Recordset")
rsDisplay.cachesize = 20
rsDisplay.Open strSqlQ, my_Conn, adOpenForwardOnly, adLockReadOnly, adCmdText
iDisplayData = rsDisplay.GetRows(20)
iDisplayCount = UBound(iDisplayData, 2)
inti = 0
dPhoto_URL = 0
dListing_ID = 1
dTopic_ID = 2
dT_Status = 3
dT_Subject = 4
iDisplay = 0
For AB = 0 To 1
	If intRows < 10 Then
		Response.Write	"					<tr height=""275"" valign=""bottom"">" & vbNewLine
		For ik = 1 To 2
			Response.Write	"						<td width=""50%"" align=""center"" bgcolor=""" & strForumCellColor & """>" & vbNewLine & _
				"	<font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strDefaultFontColor & """><b>" & vbNewLine & _
				"<a href=""" & iDisplayData(dPhoto_URL, iDisplay) & """ target=""_blank"" style=""text_decoration:none;""><img src=""" & iDisplayData(dPhoto_URL, iDisplay) & """ height=""250"" /></a><br />" & vbNewLine & _
				"<a title=""See topic"" href=""topic.asp?TOPIC_ID="& iDisplayData(dTopic_ID, iDisplay) & """ target=""_blank"">" & iDisplayData(dT_Subject, iDisplay) & "</a>" & vbNewLine & _
				"</b></font></td>" & vbNewLine
			LastID = iDisplayData(dTopic_ID, iDisplay)
			iDisplay = iDisplay + 1
			While iDisplayData(dTopic_ID, iDisplay) = LastID
				iDisplay = iDisplay + 1
			Wend
			If iDisplay > iDisplayCount Then Exit For
		Next
		Response.Write	"					</tr>" & vbNewLine
		intRows = intRows + 1
		If intRows > 10 Then Exit For
	End If
Next
rsDisplay.Close
Set rsDisplay = Nothing
Response.Write	"					</table>" & vbNewLine
WriteFooter
Response.End