<% response.expires = now - 1 strPath = "d:\martijn\whizzkid.nu\www\old\content\drawings\" dim objFS set objFS = server.createobject("SCRIPTING.FILESYSTEMOBJECT") dim objDB dim count, countTo count=0 Set objDB=server.createobject("ADODB.CONNECTION") objDB.open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=d:\www.whizzkid.nu\www\old\database\whizzkid.mdb" countTo = cint(request("id")) set adoRS = objDB.execute ("select * from tblimage where imagefilename like '%jpg' order by imageID asc") while not adoRS.eof if (objFS.fileExists(strPath &adoRS("imagefilename"))) then count = count + 1 if countTo = count then response.redirect "drawings/tn_" & adoRS("imagefilename") end if adoRS.moveNext wend adoRS.close objDB.close %>