help with db recordset

help with db recordset

am 23.01.2005 21:01:28 von CT

Hi There, I am new to asp, i am creating an app using asp/access2000 my site
is live/
http://shopgpbikes.com/sport.asp

What I am looking to do is when thumbnail is clicked
i want the record set plus the large image to appear in the popup. As it is
now just the large image shows in the popup.
Any help would be greatly appreciated.
CT.

Re: help with db recordset

am 24.01.2005 04:46:47 von jeff.nospam

On Sun, 23 Jan 2005 15:01:28 -0500, "ct"
wrote:

>Hi There, I am new to asp, i am creating an app using asp/access2000 my site
>is live/
>http://shopgpbikes.com/sport.asp
>
>What I am looking to do is when thumbnail is clicked
>i want the record set plus the large image to appear in the popup. As it is
>now just the large image shows in the popup.
>Any help would be greatly appreciated.

Obvious answer: Add the code to display whatever you want in the
popup window.

Unfortunately, we can't see your code so we can't help on that end.
You can loop through the recordset and display it, but without an idea
of your record layout and columnh structure it's tough to even suggest
code.

Jeff

Re: help with db recordset

am 24.01.2005 16:53:31 von Charlie Terzo

Here is the code for the sport.asp

<%@ LANGUAGE="VBSCRIPT" %>
<%Response.Buffer=TRUE%>
<%
Dim cnnSimple ' ADO connection
Dim rstSimple ' ADO recordset
Dim strDBPath ' path to our Access database (*.mdb) file


' MapPath of virtual database file path to a physical path.
' If you want you could hard code a physical path here.
strDBPath = Server.MapPath("bikes.mdb")


' Create an ADO Connection to connect to the scratch database.
' We're using OLE DB but you could just as easily use ODBC or a DSN.
Set cnnSimple = Server.CreateObject("ADODB.Connection")

' This line is for the Access sample database:
cnnSimple.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" &
strDBPath & ";"



' Execute a query using the connection object. It automatically
' creates and returns a recordset which we store in our variable.
Set rstSimple = cnnSimple.Execute("SELECT * FROM sport where year <=1997
")


' Display a table of the data in the recordset. We loop through the
' recordset displaying the fields from the table and using MoveNext
' to increment to the next record. We stop when we reach EOF.
%>








:: GP Bikes Fine Motorsports :: Motorcycles :: We Buy, Sell, &<br /> Trade all Makes, Models, & Years::








height="115">








border="0" src="images/header_image3.jpg" width="800" height="160">


  href="sport.asp" target="_self"> color="#FFFFFF">Sport
Bikes
face="Verdana"> 
:: 
size="1" face="Verdana" color="#FFFFFF">Cruising
Bikes
face="Verdana"> 
:: 
size="1" face="Verdana" color="#FFFFFF">Touring
Bikes
face="Verdana">  :: target="_self"> color="#FFFFFF">Motorcross face="Verdana"> 
:: 
size="1" face="Verdana" color="#FFFFFF">Scooters color="#FFFFFF" size="1" face="Verdana"> 
::  size="1" face="Verdana" color="#FFFF00">Sell
a Bike




cellspacing="0" cellpadding="0" height="24">




height="27">




face="Verdana" size="4">Sport
Bikes






background="images/contentbg.gif" height="210">













size="2" face="Verdana" color="#FF0000">:: face="Verdana" color="#FFFFFF">
target="_self">1997
& Earlier


size="2" face="Verdana" color="#FF0000">:: face="Verdana" color="#FFFFFF">
size="2" face="Verdana" color="#FFFFFF">1998
to Date


height="75" src="images/suppliers.swf">

href="subscribe.html"> height="75" border="0">

width="547">


height="3">

<%
Do While Not rstSimple.EOF
%>








width="258" valign="top">





width="258" valign="top"> color="#C0C0C0">

<%= rstSimple("enticer") %>









<%
rstSimple.MoveNext
Loop
%>



href="javascript:launch('images/bikes/<%= rstSimple("image_lrg")
%>')"> width="150"
height="97" border="0"


valign="top">Year
:
size="2" color="#C0C0C0">

<%= rstSimple("year")
%>

face="Arial" size="2" color="#FFffff">Make
:
size="2" color="#C0C0C0">

<%= rstSimple("make")
%>

face="Arial" size="2" color="#FFffff">Model
:
size="2" color="#C0C0C0">

<%= rstSimple("model")
%>

face="Arial" size="2" color="#FFffff">Description
:
size="2" color="#C0C0C0">

<%= rstSimple("description")
%>

face="Arial" size="2" color="#FFffff">Stock
Number :
size="3" color="#FF0000" face="Verdana">

<%= rstSimple("sku") %>

size="3" color="#FF0000" face="Verdana">Price
:
size="3" face="Verdana">

<%= rstSimple("price") %>


face="Arial">............................................... ............
............................................................ ............
.....................................


<%
' Close our recordset and connection and dispose of the objects
rstSimple.Close
Set rstSimple = Nothing
cnnSimple.Close
Set cnnSimple = Nothing

' That's all folks!
%>















*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Re: help with db recordset

am 24.01.2005 22:58:04 von jeff.nospam

On Mon, 24 Jan 2005 07:53:31 -0800, Charlie Terzo
wrote:

In the future, try to post only the relevant code, not the entire
page. Stripping out formatting helps too. At any rate, I think the
issue you're asking about is here:

>
>

>href="javascript:launch('images/bikes/<%= rstSimple("image_lrg")
>%>')"> width="150"
>height="97" border="0"


>
>valign="top">Year
> :
>size="2" color="#C0C0C0">
>

<%= rstSimple("year")
>%>

> >face="Arial" size="2" color="#FFffff">Make
> :
>size="2" color="#C0C0C0">
>

<%= rstSimple("make")
>%>

> >face="Arial" size="2" color="#FFffff">Model
> :
>size="2" color="#C0C0C0">
>

<%= rstSimple("model")
>%>

> >face="Arial" size="2" color="#FFffff">Description
> :
>size="2" color="#C0C0C0">
>

<%= rstSimple("description")
>%>


This apparently displays a single record, with all the information and
a Popup of the image in a larger format. That uses this portion of
the code (code wraps):

> >href="javascript:launch('images/bikes/<%= rstSimple("image_lrg")
>%>')"> width="150"
>height="97" border="0"

The JavaScript link only displays the image, nothing else. To display
the rest, you need to modify the link above to do more than just
launch the image file.

What you might do is use the primary key for the record (couldn't tell
waht it was or even if you have one...) and call a new page and pass
that value to it, then re-read the database for just that record and
display the details. Sort of like:

Link:


target=_blank">
width="150" height="97" border="0"


ShowDetails.asp:

<%

ItemID = Request.Querystring("ItemID")
strDBPath = Server.MapPath("bikes.mdb")
Set cnnSimple = Server.CreateObject("ADODB.Connection")
cnnSimple.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" &
strDBPath & ";"
Set rstSimple = cnnSimple.Execute("SELECT * FROM sport where
PrimaryKeyField = ItemID
")

{ Display the fields, blah, blah, blah... }

Keep in mind this isn't tested and syntax is from memory, but easy
enough to Google. You'll need to change your field names and make
sure you have a unique ID field (primary Key).

Jeff

Re: help with db recordset

am 24.01.2005 23:48:12 von CT

Thanks so much!
I will work on this.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!