FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


ASP Problem





mathew
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:
<%@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]
Marcio
mathew wrote:
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:
<%@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


%>


Hi mathew,

If you are housing this page here in the FRIHOST, the errors with pages in ASP you will be continuos, because here the server does not have support for ASP.

Only serving Microsoft with Support.

I also got problems with my page, I was informed that the majority of the servers does not have has supported to the ASP.

I wait to have informed well Wink

Bye
Related topics
Problem with Subdomains
Strange Fire fox problem
Hibernation problem
Logout problem (Cookie?)
How to solve this problem? Thanks
I have a problem....Mozilla Firefox
post nuke problem
Using TinyMCE with ASP.NET
any one has a problem in aactive server page??????????
good site to learn php or asp?
PHP VS ASP
Help Me To Place Asp Calender Control Over Dropdown Box!
ASP.NET 1.0 email form
asp and xml
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.