I am trying to set up a website thru asp. I want to put a photos page on it. I have the photos under different categorys in a database and the initial photos page just lists the categories. I want to make the page the category name links to display the first photo in the group and a next and previous button below it to navigate the photos in the category.
I tried the following code but its full of errors. Is there an easier way or how should the code be written.
Thabks in advance for the help
[/quote]
I tried the following code but its full of errors. Is there an easier way or how should the code be written.
Thabks in advance for the help
| Quote: |
| <%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<%option explicit%> <%function photo 'declare variables dim oCn, oRS, strSQL, piccode, id, thegroup, back, forward thegroup = request.querystring("group") strSQL = "SELECT * FROM photo WHERE group='" & thegroup & "'" set oCN = server.createobject("ADODB.Connection") oCN.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" _ & Server.Mappath("db/homepg.mdb") set oRS= oCn.execute( strSQL ) back = oRS.moveprevious forward = oRS.movenext 'error checking if err.number = 0 then 'check to see if recordset is empty if oRS.EOF and oRS.BOF then response.write "Nothing happening at the moment!!" else 'loop here do while not oRS.EOF response.write "<a class='largephoto' href='photos/" & oRS("photo") & ".jpg'> <img src='" & oRS("photo") & ".jpg'></a>" response.write "<br><a class='photodetail' href='photos/" & oRS("photo") & ".jpg'>" & oRS("details") & "</a>" response.write "<br><img src='images/back.gif' onmousedown='"& back &"'><img src='images/spacer.gif'><img src='images/forward.gif' onmousedown='" & forward & "'>" loop end if else response.write "<br/>Thechnical problem!<br/>I'm looking in to it!" end if oRS.close oCn.close set oRS=nothing set oCn=nothing end function %> |
[/quote]
