How to show a number of items in an asp web page?

Peter J. Boettcher's picture

They have: 812 posts

Joined: Feb 2000

Simon,

First you would have to do a select statement to see if there were any new records.

After that you could use code like this:

<%If CheckForNewRecords.EOF <> True Then%>
<form name=newtree method=post action=newtree.asp?id=<%CheckForNewRecords("TreeID")%>
<input type=submit name=submit value="Next Tree">
</form>
<%End If%>

Then in newtree.asp you would do something like:

<% NewTree = Request("id")
If NewTree <> "" Then
Conn.Open 'open your db connection here
SQL = SELECT * From Trees WHERE TreeID = '" & NewTree & "'"
Set DisplayTree = Conn.Execute(SQL)
%>
<% If DisplayTree.EOF <> True Then %>
<p><img src=<%DisplayTree("image")%></p>
<% End If %>

I'm making up my own database field names so you would obviously insert your field names there, but something like this would do the trick.

Regards,
Peter J. Boettcher

PJ | Are we there yet?
pjboettcher.com

They have: 12 posts

Joined: Mar 2000

Hi Mr,

I have a asp web page, that display the tree photos that I have in my microsoft access database.

I would like to know how to make a next button, so if I add a new photo, i would see it just on the next page. Because, I want to have only tree pictures by pages.

How would I do that?

Thank you for your collaboration.

Best Regards

Simon Baillargeon

Simon Baillargeon

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.