Displaying two database results

R

Ruffred

maybe I am trying to hardto please the boss but what I am trying to do is

displaying the details of a datbase record and using the contents of a field
in that database as the search word to display all pictures in another db
that relate to the dispayed record.

I have the details listed and the second db on the same page (but am copying
and pasting the link) from the details area to the search field the pressing
search button.

Surely there is some coade that I can use to use field in the details area
to automatically search thelist below for associate records.

I will keep trying to sort this out and hopefully find a solution somewhere

Thanks in advance
Ruffred
 
R

Ruffred

The field in the details database that is displayed at the top of the page
has a field name - image_group. It is the contents of this field that
iscopy and pasted into the search field with a query as below

SELECT * FROM Gallery WHERE (Location_Trip LIKE '::Caption::')
 
T

Thomas A. Rowe

Ok, then in your next query use

"SELECT * FROM OtherDatabase WHERE (image_group = '" & fp_rs1("image_group") & "')"

"fp_rs1" is the name of the first recordset used by your first query, This recordset must have a
unique name.
--
==============================================
Thomas A. Rowe
Microsoft MVP - FrontPage

http://www.Ecom-Data.com
==============================================
 
R

Ruffred

Not Quite sure what you mean maybe a bit brain dead at the momen as I have
been working on this all day. Here is the link to the page which show the
two dbs the top is the detail from the previous displayed list and below
picture gallery is the contents of the gallery. The image_group_title field
in the details (db name REPORTS - field name IMAGES) that should govern the
list below (db name GALLERY - field name IMAGES.

http://68.178.203.233/flyfish/cville/reports/editor/detail.asp?TripID=1

Regards
Tony
 
T

Thomas A. Rowe

Can you paste the complete code segments for both queries?


--
==============================================
Thomas A. Rowe
Microsoft MVP - FrontPage

http://www.Ecom-Data.com
==============================================
 
R

Ruffred

Thomas here you go. I have tried a few things but no luck hopefully this is
what you need and it isn't too big.

---------------------------------------------

<html>

<head>
<% ' FP_ASP -- ASP Automatically generated by a FrontPage Component. Do not
Edit.
FP_CharSet = "windows-1252"
FP_CodePage = 1252 %>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Reports -- Home</title>
<meta name="GENERATOR" content="Microsoft FrontPage 6.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
</head>

<body bgcolor="#FFFFFF">

<!--webbot bot="PurpleText" PREVIEW="-Important- If you modify this
Database Results region using the Database Results Wizard, then your Database
Editor will no longer work. If you accidentally open the Database Results
Wizard, simply click Cancel to exit without regenerating the Database Results
region." -->
<!--webbot bot="DatabaseRegionStart" s-columnnames="TripID,MemberID,Trip
Name,Location,Members_present,Guests,Trip Date,Intro,Conditions,Best
Flies,Fishing,Images,Memorable Moments,Awards"
s-columntypes="3,3,202,202,203,203,135,203,203,203,203,202,203,203"
s-dataconnection="cville" b-tableformat="FALSE" b-menuformat="FALSE"
s-menuchoice s-menuvalue b-tableborder="TRUE" b-tableexpand="TRUE"
b-tableheader="TRUE" b-listlabels="TRUE" b-listseparator="FALSE"
i-ListFormat="5" b-makeform="FALSE" s-RecordSource="Reports"
s-displaycolumns="TripID,MemberID,Trip
Name,Location,Members_present,Guests,Trip Date,Intro,Conditions,Best
Flies,Fishing,Images,Memorable Moments,Awards" s-criteria="{TripID} EQ
{TripID} +" s-order s-sql="SELECT * FROM Reports WHERE TripID = ::TripID::"
b-procedure="FALSE" clientside SuggestedExt="asp" s-DefaultFields="TripID=0"
s-NoRecordsFound="No records returned." i-MaxRecords="1" i-GroupSize="0"
u-dblib="../../../_fpclass/fpdblib.inc"
u-dbrgn1="../../../_fpclass/fpdbrgn1.inc"
u-dbrgn2="../../../_fpclass/fpdbrgn2.inc" Tag="BODY" startspan BOTID="0"
preview="<table border=0 width="100%"><tr><td bgcolor="#FFFF00"><font
color="#000000">This is the start of a Database Results region. The page must
be fetched from a web server with a web browser to display correctly; the
current web is stored on your local disk or
network.</font></td></tr></table>" --><!--#include
file="../../../_fpclass/fpdblib.inc"-->
<% if 0 then %>
<SCRIPT Language="JavaScript">
document.write("<div style='background: yellow; color: black;'>The Database
Results component on this page is unable to display database content. The
page must have a filename ending in '.asp', and the web must be hosted on a
server that supports Active Server Pages.</div>");
</SCRIPT>
<% end if %>
<%
fp_sQry="SELECT * FROM Reports WHERE TripID = ::TripID::"
fp_sDefault="TripID=0"
fp_sNoRecords="No records returned."
fp_sDataConn="cville"
fp_iMaxRecords=1
fp_iCommandType=1
fp_iPageSize=0
fp_fTableFormat=False
fp_fMenuFormat=False
fp_sMenuChoice=""
fp_sMenuValue=""
fp_sColTypes="&TripID=3&MemberID=3&Trip
Name=202&Location=202&Members_present=203&Guests=203&Trip
Date=135&Intro=203&Conditions=203&Best
Flies=203&Fishing=203&Images=202&Memorable Moments=203&Awards=203&"
fp_iDisplayCols=14
fp_fCustomQuery=False
BOTID=0
fp_iRegion=BOTID
%>
<!--#include file="../../../_fpclass/fpdbrgn1.inc"-->
<!--webbot bot="DatabaseRegionStart" endspan i-checksum="63063" -->

<table BORDER=0 width="100%">

<tr>
<td colspan="3" align="center"><hr></td>
</tr>

<tr>
<td colspan="3" align="center"><font size="5" face="Bauhaus 93"
color="#0000FF">
<!--webbot bot="DatabaseResultColumn" s-columnnames="TripID,MemberID,Trip
Name,Location,Members_present,Guests,Trip Date,Intro,Conditions,Best
Flies,Fishing,Images,Memorable Moments,Awards" s-column="Trip Name"
b-tableformat="TRUE" b-hasHTML="FALSE" clientside startspan b-makelink
b-MenuFormat preview="<font size="-1">&lt;&lt;</font>Trip Name<font
size="-1">&gt;&gt;</font>" --><%=FP_FieldVal(fp_rs,"Trip Name")%><!--webbot
bot="DatabaseResultColumn" endspan i-checksum="20409" --></font></td>
</tr><tr>
<td colspan="3" align="center"><font face="Arial"><span style="font-size:
11pt">
<!--webbot bot="DatabaseResultColumn" s-columnnames="TripID,MemberID,Trip
Name,Location,Members_present,Guests,Trip Date,Intro,Conditions,Best
Flies,Fishing,Images,Memorable Moments,Awards" s-column="Location"
b-tableformat="TRUE" b-hasHTML="FALSE" clientside startspan b-makelink
b-MenuFormat preview="<font size="-1">&lt;&lt;</font>Location<font
size="-1">&gt;&gt;</font>" --><%=FP_FieldVal(fp_rs,"Location")%><!--webbot
bot="DatabaseResultColumn" endspan i-checksum="16691" --></span></font></td>
</tr><tr>
<td colspan="3" align="center"><b><font style="font-size: 11pt" face="Arial">
<font color="#0000FF">Trip Date</font> </font></b><font face="Arial">
<span style="font-size: 11pt">
<!--webbot bot="DatabaseResultColumn" s-columnnames="TripID,MemberID,Trip
Name,Location,Members_present,Guests,Trip Date,Intro,Conditions,Best
Flies,Fishing,Images,Memorable Moments,Awards" s-column="Trip Date"
b-tableformat="TRUE" b-hasHTML="FALSE" clientside startspan b-makelink
b-MenuFormat preview="<font size="-1">&lt;&lt;</font>Trip Date<font
size="-1">&gt;&gt;</font>" --><%=FP_FieldVal(fp_rs,"Trip Date")%><!--webbot
bot="DatabaseResultColumn" endspan i-checksum="20553" --></span></font></td>
</tr><tr>
<td width="99%" colspan="3"><hr></td>
</tr><tr>
<td width="47%" colspan="2"><b>
<font style="font-size: 11pt" face="Arial" color="#0000FF"><br>
Members</font></b></td>
<td width="52%">
<b><font style="font-size: 11pt" face="Arial"
color="#0000FF">Guests</font></b></td>
</tr><tr>
<td width="47%" colspan="2"><font face="Arial"><span style="font-size: 11pt">
<!--webbot bot="DatabaseResultColumn" s-columnnames="TripID,MemberID,Trip
Name,Location,Members_present,Guests,Trip Date,Intro,Conditions,Best
Flies,Fishing,Images,Memorable Moments,Awards" s-column="Members_present"
b-tableformat="TRUE" b-hasHTML="FALSE" clientside startspan b-makelink
b-MenuFormat preview="<font size="-1">&lt;&lt;</font>Members_present<font
size="-1">&gt;&gt;</font>"
--><%=FP_FieldVal(fp_rs,"Members_present")%><!--webbot
bot="DatabaseResultColumn" endspan i-checksum="41239" --></span></font></td>
<td width="52%">
<font face="Arial"><span style="font-size: 11pt">
<!--webbot bot="DatabaseResultColumn" s-columnnames="TripID,MemberID,Trip
Name,Location,Members_present,Guests,Trip Date,Intro,Conditions,Best
Flies,Fishing,Images,Memorable Moments,Awards" s-column="Guests"
b-tableformat="TRUE" b-hasHTML="FALSE" clientside startspan b-makelink
b-MenuFormat preview="<font size="-1">&lt;&lt;</font>Guests<font
size="-1">&gt;&gt;</font>" --><%=FP_FieldVal(fp_rs,"Guests")%><!--webbot
bot="DatabaseResultColumn" endspan i-checksum="16536" --></span></font></td>
</tr><tr>
<td colspan="3">
<hr></td>
</tr><tr>
<td colspan="3">
<p align="left"><b><font face="Arial" color="#0000FF">The Trip</font></b></p>
<p align="left"><font face="Arial"><span style="font-size: 11pt">
<!--webbot bot="DatabaseResultColumn" s-columnnames="TripID,MemberID,Trip
Name,Location,Members_present,Guests,Trip Date,Intro,Conditions,Best
Flies,Fishing,Images,Memorable Moments,Awards" s-column="Intro"
b-tableformat="TRUE" b-hasHTML="FALSE" clientside startspan b-makelink
b-MenuFormat preview="<font size="-1">&lt;&lt;</font>Intro<font
size="-1">&gt;&gt;</font>" --><%=FP_FieldVal(fp_rs,"Intro")%><!--webbot
bot="DatabaseResultColumn" endspan i-checksum="8761" --></span></font></td>
</tr><tr>
<td width="99%" colspan="3"><hr></td>
</tr><tr>
<td width="21%"><b><font style="font-size: 11pt" face="Arial"
color="#0000FF">Conditions</font></b></td>
<td width="78%" colspan="2">
<font face="Arial"><span style="font-size: 11pt">
<!--webbot bot="DatabaseResultColumn" s-columnnames="TripID,MemberID,Trip
Name,Location,Members_present,Guests,Trip Date,Intro,Conditions,Best
Flies,Fishing,Images,Memorable Moments,Awards" s-column="Conditions"
b-tableformat="TRUE" b-hasHTML="FALSE" clientside startspan b-makelink
b-MenuFormat preview="<font size="-1">&lt;&lt;</font>Conditions<font
size="-1">&gt;&gt;</font>" --><%=FP_FieldVal(fp_rs,"Conditions")%><!--webbot
bot="DatabaseResultColumn" endspan i-checksum="31047" --></span></font></td>
</tr><tr>
<td width="99%" colspan="3"><hr></td>
</tr><tr>
<td width="21%"><b><font style="font-size: 11pt" face="Arial"
color="#0000FF">Best Flies</font></b></td>
<td width="78%" colspan="2">
<font face="Arial"><span style="font-size: 11pt">
<!--webbot bot="DatabaseResultColumn" s-columnnames="TripID,MemberID,Trip
Name,Location,Members_present,Guests,Trip Date,Intro,Conditions,Best
Flies,Fishing,Images,Memorable Moments,Awards" s-column="Best Flies"
b-tableformat="TRUE" b-hasHTML="FALSE" clientside startspan b-makelink
b-MenuFormat preview="<font size="-1">&lt;&lt;</font>Best Flies<font
size="-1">&gt;&gt;</font>" --><%=FP_FieldVal(fp_rs,"Best Flies")%><!--webbot
bot="DatabaseResultColumn" endspan i-checksum="28360" --></span></font></td>
</tr><tr>
<td width="99%" colspan="3"><hr></td>
</tr><tr>
<td width="21%"><b><font style="font-size: 11pt" face="Arial" color="#0000FF">
The Fishing</font></b></td>
<td width="78%" colspan="2">
<font face="Arial"><span style="font-size: 11pt">
<!--webbot bot="DatabaseResultColumn" s-columnnames="TripID,MemberID,Trip
Name,Location,Members_present,Guests,Trip Date,Intro,Conditions,Best
Flies,Fishing,Images,Memorable Moments,Awards" s-column="Fishing"
b-tableformat="TRUE" b-hasHTML="FALSE" clientside startspan b-makelink
b-MenuFormat preview="<font size="-1">&lt;&lt;</font>Fishing<font
size="-1">&gt;&gt;</font>" --><%=FP_FieldVal(fp_rs,"Fishing")%><!--webbot
bot="DatabaseResultColumn" endspan i-checksum="12842" --></span></font></td>
</tr><tr>
<td width="99%" colspan="3"><hr></td>
</tr><tr>
<td width="21%"><b><font style="font-size: 11pt" face="Arial"
color="#0000FF">Memorable Moments</font></b></td>
<td width="78%" colspan="2">
<font face="Arial"><span style="font-size: 11pt">
<!--webbot bot="DatabaseResultColumn" s-columnnames="TripID,MemberID,Trip
Name,Location,Members_present,Guests,Trip Date,Intro,Conditions,Best
Flies,Fishing,Images,Memorable Moments,Awards" s-column="Memorable Moments"
b-tableformat="TRUE" b-hasHTML="FALSE" clientside startspan b-makelink
b-MenuFormat preview="<font size="-1">&lt;&lt;</font>Memorable Moments<font
size="-1">&gt;&gt;</font>" --><%=FP_FieldVal(fp_rs,"Memorable
Moments")%><!--webbot bot="DatabaseResultColumn" endspan i-checksum="37234"
--></span></font></td>
</tr><tr>
<td width="99%" colspan="3"><hr></td>
</tr>


<tr>
<td width="21%"><b><font style="font-size: 11pt" face="Arial"
color="#0000FF">Awards</font></b></td>
<td width="78%" colspan="2">
<font face="Arial"><span style="font-size: 11pt">
<!--webbot bot="DatabaseResultColumn" s-columnnames="TripID,MemberID,Trip
Name,Location,Members_present,Guests,Trip Date,Intro,Conditions,Best
Flies,Fishing,Images,Memorable Moments,Awards" s-column="Awards"
b-tableformat="TRUE" b-hasHTML="FALSE" clientside startspan b-makelink
b-MenuFormat preview="<font size="-1">&lt;&lt;</font>Awards<font
size="-1">&gt;&gt;</font>" --><%=FP_FieldVal(fp_rs,"Awards")%><!--webbot
bot="DatabaseResultColumn" endspan i-checksum="16338" --></span></font></td>
</tr>


<tr>
<td width="99%" colspan="3"><hr></td>
</tr>


<tr>
<td width="21%"><b><font style="font-size: 11pt" face="Arial"
color="#0000FF">Image
Group Title</font></b></td>
<td width="78%" colspan="2">
<font face="Arial"><span style="font-size: 11pt">

<!--webbot bot="DatabaseResultColumn" s-columnnames="TripID,MemberID,Trip
Name,Location,Members_present,Guests,Trip Date,Intro,Conditions,Best
Flies,Fishing,Images,Memorable Moments,Awards" s-column="Images"
b-tableformat="TRUE" b-hasHTML="FALSE" clientside startspan b-makelink
b-MenuFormat preview="<font size="-1">&lt;&lt;</font>Images<font
size="-1">&gt;&gt;</font>" --><%=FP_FieldVal(fp_rs,"Images")%><!--webbot
bot="DatabaseResultColumn" endspan i-checksum="15552"
--></a></span></font></td>
</tr>


<tr>
<td width="99%" colspan="3">
</td>
</tr>

</table>

<!--webbot bot="DatabaseRegionEnd" b-tableformat="FALSE"
b-menuformat="FALSE" u-dbrgn2="../../../_fpclass/fpdbrgn2.inc"
i-groupsize="0" clientside Tag="BODY" startspan preview="<table border=0
width="100%"><tr><td bgcolor="#FFFF00"><font color="#000000">This is the end
of a Database Results region.</font></td></tr></table>" --><!--#include
file="../../../_fpclass/fpdbrgn2.inc"-->
<!--webbot bot="DatabaseRegionEnd" endspan i-checksum="9297" -->
<table border="0" width="100%" id="table1">
<tr>
<td><hr></td>
</tr>
<tr>
<td><font face="Arial Rounded MT Bold" size="4" color="#0000FF">Trip
Images</font></td>
</tr>
</table>

<table width="100%" border="0" cellpadding="2" id="table2">
<thead>
<tr>
<th style="color: #FFFFFF" bgcolor="#000000">
<font face="Arial" style="font-size: 11pt">
<span style="font-weight: 400"><b>Image</b></span></font></th>
<th style="color: #FFFFFF" bgcolor="#000000">
<font face="Arial" style="font-size: 11pt">
<span style="font-weight: 400"><b>Location/Trip</b></span></font></th>
<th style="color: #FFFFFF" bgcolor="#000000">
<font face="Arial" style="font-size: 11pt">
<span style="font-weight: 400"><b>Caption</b></span></font></th>
<th style="color: #FFFFFF" bgcolor="#000000">
<font face="Arial" style="font-size: 11pt">
<span style="font-weight: 400"><b>Date</b></span></font></th>
</tr>
</thead>
<tbody>
<!--webbot bot="DatabaseRegionStart"
s-columnnames="PhotoID,MemberID,Location_Trip,Photo,Caption,Description,Date"
s-columntypes="3,3,202,202,202,203,135" s-dataconnection="cville"
b-tableformat="TRUE" b-menuformat="FALSE" s-menuchoice="Caption"
s-menuvalue="Caption" b-tableborder="TRUE" b-tableexpand="TRUE"
b-tableheader="TRUE" b-listlabels="TRUE" b-listseparator="TRUE"
i-listformat="0" b-makeform="TRUE" s-recordsource="Gallery"
s-displaycolumns="Photo,Location_Trip,Caption,Date" s-criteria="[Caption] LK
{Caption} | [Location_Trip] LK {Caption} | [Description] LK {Caption} +"
s-order s-sql="SELECT * FROM Gallery WHERE (location_trip like
(Reports(Images))"" b-procedure="FALSE" clientside suggestedext="asp"
s-defaultfields="Caption=&amp;Caption=&amp;Caption=" s-norecordsfound="No
records returned." i-maxrecords="0" i-groupsize="0" botid="1"
u-dblib="../../../_fpclass/fpdblib.inc"
u-dbrgn1="../../../_fpclass/fpdbrgn1.inc"
u-dbrgn2="../../../_fpclass/fpdbrgn2.inc" tag="TBODY" preview="<tr><td
colspan=64 bgcolor="#FFFF00" width="100%"><font color="#000000">This is the
start of a Database Results region. The page must be fetched from a web
server with a web browser to display correctly; the current web is stored on
your local disk or network.</font></td></tr>" startspan b-UseDotNET="FALSE"
CurrentExt sa-InputTypes="202,202,203" b-DataGridFormat="FALSE"
b-DGridAlternate="TRUE" sa-CritTypes="202,202,203" b-WasTableFormat="TRUE"
b-ReplaceDatabaseRegion="FALSE" --><!--#include
file="../../../_fpclass/fpdblib.inc"-->
<% if 0 then %>
<SCRIPT Language="JavaScript">
document.write("<div style='background: yellow; color: black;'>The Database
Results component on this page is unable to display database content. The
page must have a filename ending in '.asp', and the web must be hosted on a
server that supports Active Server Pages.</div>");
</SCRIPT>
<% end if %>
<%
fp_sQry="SELECT * FROM Gallery WHERE (location_trip like (Reports(Images))"
fp_sDefault="Caption=&Caption=&Caption="
fp_sNoRecords="<tr><td colspan=4 align=""LEFT"" width=""100%"">No records
returned.</td></tr>"
fp_sDataConn="cville"
fp_iMaxRecords=0
fp_iCommandType=1
fp_iPageSize=0
fp_fTableFormat=True
fp_fMenuFormat=False
fp_sMenuChoice="Caption"
fp_sMenuValue="Caption"
fp_sColTypes="&PhotoID=3&MemberID=3&Location_Trip=202&Photo=202&Caption=202&Description=203&Date=135&"
fp_iDisplayCols=4
fp_fCustomQuery=False
BOTID=1
fp_iRegion=BOTID
%>
<!--#include file="../../../_fpclass/fpdbrgn1.inc"-->
<!--webbot bot="DatabaseRegionStart" endspan i-checksum="15065" --><tr>
<td align="left" valign="top">
<font face="Arial" style="font-size: 11pt">
<img border="2"
src="http://68.178.203.233/ffo_cv/cv_images/th<%=FP_FieldLink(fp_rs,"Photo")%>" width="75"></font></td>
<td align="left" valign="top">
<a href="detail.asp?PhotoID=<%=FP_FieldURL(fp_rs,"PhotoID")%>"
target="_self">

<font face="Arial" style="font-size: 11pt">

<!--webbot bot="DatabaseResultColumn"
s-columnnames="PhotoID,MemberID,Location_Trip,Photo,Caption,Description,Date"
s-column="Caption" b-tableformat="TRUE" b-hashtml="FALSE" b-makelink="FALSE"
clientside b-MenuFormat preview="<font size="-1">&lt;&lt;</font>Caption<font
size="-1">&gt;&gt;</font>" startspan
--><%=FP_FieldVal(fp_rs,"Caption")%><!--webbot bot="DatabaseResultColumn"
endspan i-checksum="11767" --></font></td>
<td align="left" valign="top">

<font face="Arial" style="font-size: 11pt">
<!--webbot bot="DatabaseResultColumn"
s-columnnames="PhotoID,MemberID,Location_Trip,Photo,Caption,Description,Date"
s-column="Location_Trip" b-tableformat="TRUE" b-hashtml="FALSE"
b-makelink="FALSE" clientside b-MenuFormat preview="<font
size="-1">&lt;&lt;</font>Location_Trip<font size="-1">&gt;&gt;</font>"
startspan s-ColumnTypes="3,3,202,202,202,203,135"
--><%=FP_FieldVal(fp_rs,"Location_Trip")%><!--webbot
bot="DatabaseResultColumn" endspan i-checksum="32790" --></font></td>
<td align="left" valign="top">
<font face="Arial" style="font-size: 11pt">
<!--webbot bot="DatabaseResultColumn"
s-columnnames="PhotoID,MemberID,Location_Trip,Photo,Caption,Description,Date"
s-column="Date" b-tableformat="TRUE" b-hashtml="FALSE" b-makelink="FALSE"
clientside b-MenuFormat preview="<font size="-1">&lt;&lt;</font>Date<font
size="-1">&gt;&gt;</font>" startspan
--><%=FP_FieldVal(fp_rs,"Date")%><!--webbot bot="DatabaseResultColumn"
endspan i-checksum="3267" --></font></td>
</tr>
<!--webbot bot="DatabaseRegionEnd" b-tableformat="TRUE"
b-menuformat="FALSE" u-dbrgn2="../../../_fpclass/fpdbrgn2.inc"
i-groupsize="0" clientside tag="TBODY" preview="<tr><td colspan=64
bgcolor="#FFFF00" width="100%"><font color="#000000">This is the end of a
Database Results region.</font></td></tr>" startspan --><!--#include
file="../../../_fpclass/fpdbrgn2.inc"-->
<!--webbot bot="DatabaseRegionEnd" endspan i-checksum="9297" --></tbody>
</table>


</body>

</html>

-----------------------------------------------
 
T

Thomas A. Rowe

I think you are going to have to learn to write your own ASP/VBScript unless someone that use the FP
database component can help you.

Here is how I would do it via hand written ASP/VBScript:

<%
TripID = Request.Form("TripID")


set ReportRS = server.CreateObject("ADODB.Recordset")
ReportSQL = "SELECT * FROM Reports WHERE TripID = '" & TripID & "'"
ReportRS.Open ReportSQL, Conn

ImageID = ReportRS("Images")


set GalleryRS = server.CreateObject("ADODB.Recordset")
GallerySQL = "SELECT * FROM Gallery WHERE location_trip = '" & ImageID & "'"
GalleryRS.Open GallerySQL, Conn
%>
--
==============================================
Thomas A. Rowe
Microsoft MVP - FrontPage

http://www.Ecom-Data.com
==============================================


Ruffred said:
Thomas here you go. I have tried a few things but no luck hopefully this is
what you need and it isn't too big.

---------------------------------------------

<html>

<head>
<% ' FP_ASP -- ASP Automatically generated by a FrontPage Component. Do not
Edit.
FP_CharSet = "windows-1252"
FP_CodePage = 1252 %>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Reports -- Home</title>
<meta name="GENERATOR" content="Microsoft FrontPage 6.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
</head>

<body bgcolor="#FFFFFF">

<!--webbot bot="PurpleText" PREVIEW="-Important- If you modify this
Database Results region using the Database Results Wizard, then your Database
Editor will no longer work. If you accidentally open the Database Results
Wizard, simply click Cancel to exit without regenerating the Database Results
region." -->
<!--webbot bot="DatabaseRegionStart" s-columnnames="TripID,MemberID,Trip
Name,Location,Members_present,Guests,Trip Date,Intro,Conditions,Best
Flies,Fishing,Images,Memorable Moments,Awards"
s-columntypes="3,3,202,202,203,203,135,203,203,203,203,202,203,203"
s-dataconnection="cville" b-tableformat="FALSE" b-menuformat="FALSE"
s-menuchoice s-menuvalue b-tableborder="TRUE" b-tableexpand="TRUE"
b-tableheader="TRUE" b-listlabels="TRUE" b-listseparator="FALSE"
i-ListFormat="5" b-makeform="FALSE" s-RecordSource="Reports"
s-displaycolumns="TripID,MemberID,Trip
Name,Location,Members_present,Guests,Trip Date,Intro,Conditions,Best
Flies,Fishing,Images,Memorable Moments,Awards" s-criteria="{TripID} EQ
{TripID} +" s-order s-sql="SELECT * FROM Reports WHERE TripID = ::TripID::"
b-procedure="FALSE" clientside SuggestedExt="asp" s-DefaultFields="TripID=0"
s-NoRecordsFound="No records returned." i-MaxRecords="1" i-GroupSize="0"
u-dblib="../../../_fpclass/fpdblib.inc"
u-dbrgn1="../../../_fpclass/fpdbrgn1.inc"
u-dbrgn2="../../../_fpclass/fpdbrgn2.inc" Tag="BODY" startspan BOTID="0"
preview="<table border=0 width="100%"><tr><td bgcolor="#FFFF00"><font
color="#000000">This is the start of a Database Results region. The page must
be fetched from a web server with a web browser to display correctly; the
current web is stored on your local disk or
network.</font></td></tr></table>" --><!--#include
file="../../../_fpclass/fpdblib.inc"-->
<% if 0 then %>
<SCRIPT Language="JavaScript">
document.write("<div style='background: yellow; color: black;'>The Database
Results component on this page is unable to display database content. The
page must have a filename ending in '.asp', and the web must be hosted on a
server that supports Active Server Pages.</div>");
</SCRIPT>
<% end if %>
<%
fp_sQry="SELECT * FROM Reports WHERE TripID = ::TripID::"
fp_sDefault="TripID=0"
fp_sNoRecords="No records returned."
fp_sDataConn="cville"
fp_iMaxRecords=1
fp_iCommandType=1
fp_iPageSize=0
fp_fTableFormat=False
fp_fMenuFormat=False
fp_sMenuChoice=""
fp_sMenuValue=""
fp_sColTypes="&TripID=3&MemberID=3&Trip
Name=202&Location=202&Members_present=203&Guests=203&Trip
Date=135&Intro=203&Conditions=203&Best
Flies=203&Fishing=203&Images=202&Memorable Moments=203&Awards=203&"
fp_iDisplayCols=14
fp_fCustomQuery=False
BOTID=0
fp_iRegion=BOTID
%>
<!--#include file="../../../_fpclass/fpdbrgn1.inc"-->
<!--webbot bot="DatabaseRegionStart" endspan i-checksum="63063" -->

<table BORDER=0 width="100%">

<tr>
<td colspan="3" align="center"><hr></td>
</tr>

<tr>
<td colspan="3" align="center"><font size="5" face="Bauhaus 93"
color="#0000FF">
<!--webbot bot="DatabaseResultColumn" s-columnnames="TripID,MemberID,Trip
Name,Location,Members_present,Guests,Trip Date,Intro,Conditions,Best
Flies,Fishing,Images,Memorable Moments,Awards" s-column="Trip Name"
b-tableformat="TRUE" b-hasHTML="FALSE" clientside startspan b-makelink
b-MenuFormat preview="<font size="-1">&lt;&lt;</font>Trip Name<font
size="-1">&gt;&gt;</font>" --><%=FP_FieldVal(fp_rs,"Trip Name")%><!--webbot
bot="DatabaseResultColumn" endspan i-checksum="20409" --></font></td>
</tr><tr>
<td colspan="3" align="center"><font face="Arial"><span style="font-size:
11pt">
<!--webbot bot="DatabaseResultColumn" s-columnnames="TripID,MemberID,Trip
Name,Location,Members_present,Guests,Trip Date,Intro,Conditions,Best
Flies,Fishing,Images,Memorable Moments,Awards" s-column="Location"
b-tableformat="TRUE" b-hasHTML="FALSE" clientside startspan b-makelink
b-MenuFormat preview="<font size="-1">&lt;&lt;</font>Location<font
size="-1">&gt;&gt;</font>" --><%=FP_FieldVal(fp_rs,"Location")%><!--webbot
bot="DatabaseResultColumn" endspan i-checksum="16691" --></span></font></td>
</tr><tr>
<td colspan="3" align="center"><b><font style="font-size: 11pt" face="Arial">
<font color="#0000FF">Trip Date</font> </font></b><font face="Arial">
<span style="font-size: 11pt">
<!--webbot bot="DatabaseResultColumn" s-columnnames="TripID,MemberID,Trip
Name,Location,Members_present,Guests,Trip Date,Intro,Conditions,Best
Flies,Fishing,Images,Memorable Moments,Awards" s-column="Trip Date"
b-tableformat="TRUE" b-hasHTML="FALSE" clientside startspan b-makelink
b-MenuFormat preview="<font size="-1">&lt;&lt;</font>Trip Date<font
size="-1">&gt;&gt;</font>" --><%=FP_FieldVal(fp_rs,"Trip Date")%><!--webbot
bot="DatabaseResultColumn" endspan i-checksum="20553" --></span></font></td>
</tr><tr>
<td width="99%" colspan="3"><hr></td>
</tr><tr>
<td width="47%" colspan="2"><b>
<font style="font-size: 11pt" face="Arial" color="#0000FF"><br>
Members</font></b></td>
<td width="52%">
<b><font style="font-size: 11pt" face="Arial"
color="#0000FF">Guests</font></b></td>
</tr><tr>
<td width="47%" colspan="2"><font face="Arial"><span style="font-size: 11pt">
<!--webbot bot="DatabaseResultColumn" s-columnnames="TripID,MemberID,Trip
Name,Location,Members_present,Guests,Trip Date,Intro,Conditions,Best
Flies,Fishing,Images,Memorable Moments,Awards" s-column="Members_present"
b-tableformat="TRUE" b-hasHTML="FALSE" clientside startspan b-makelink
b-MenuFormat preview="<font size="-1">&lt;&lt;</font>Members_present<font
size="-1">&gt;&gt;</font>"
--><%=FP_FieldVal(fp_rs,"Members_present")%><!--webbot
bot="DatabaseResultColumn" endspan i-checksum="41239" --></span></font></td>
<td width="52%">
<font face="Arial"><span style="font-size: 11pt">
<!--webbot bot="DatabaseResultColumn" s-columnnames="TripID,MemberID,Trip
Name,Location,Members_present,Guests,Trip Date,Intro,Conditions,Best
Flies,Fishing,Images,Memorable Moments,Awards" s-column="Guests"
b-tableformat="TRUE" b-hasHTML="FALSE" clientside startspan b-makelink
b-MenuFormat preview="<font size="-1">&lt;&lt;</font>Guests<font
size="-1">&gt;&gt;</font>" --><%=FP_FieldVal(fp_rs,"Guests")%><!--webbot
bot="DatabaseResultColumn" endspan i-checksum="16536" --></span></font></td>
</tr><tr>
<td colspan="3">
<hr></td>
</tr><tr>
<td colspan="3">
<p align="left"><b><font face="Arial" color="#0000FF">The Trip</font></b></p>
<p align="left"><font face="Arial"><span style="font-size: 11pt">
<!--webbot bot="DatabaseResultColumn" s-columnnames="TripID,MemberID,Trip
Name,Location,Members_present,Guests,Trip Date,Intro,Conditions,Best
Flies,Fishing,Images,Memorable Moments,Awards" s-column="Intro"
b-tableformat="TRUE" b-hasHTML="FALSE" clientside startspan b-makelink
b-MenuFormat preview="<font size="-1">&lt;&lt;</font>Intro<font
size="-1">&gt;&gt;</font>" --><%=FP_FieldVal(fp_rs,"Intro")%><!--webbot
bot="DatabaseResultColumn" endspan i-checksum="8761" --></span></font></td>
</tr><tr>
<td width="99%" colspan="3"><hr></td>
</tr><tr>
<td width="21%"><b><font style="font-size: 11pt" face="Arial"
color="#0000FF">Conditions</font></b></td>
<td width="78%" colspan="2">
<font face="Arial"><span style="font-size: 11pt">
<!--webbot bot="DatabaseResultColumn" s-columnnames="TripID,MemberID,Trip
Name,Location,Members_present,Guests,Trip Date,Intro,Conditions,Best
Flies,Fishing,Images,Memorable Moments,Awards" s-column="Conditions"
b-tableformat="TRUE" b-hasHTML="FALSE" clientside startspan b-makelink
b-MenuFormat preview="<font size="-1">&lt;&lt;</font>Conditions<font
size="-1">&gt;&gt;</font>" --><%=FP_FieldVal(fp_rs,"Conditions")%><!--webbot
bot="DatabaseResultColumn" endspan i-checksum="31047" --></span></font></td>
</tr><tr>
<td width="99%" colspan="3"><hr></td>
</tr><tr>
<td width="21%"><b><font style="font-size: 11pt" face="Arial"
color="#0000FF">Best Flies</font></b></td>
<td width="78%" colspan="2">
<font face="Arial"><span style="font-size: 11pt">
<!--webbot bot="DatabaseResultColumn" s-columnnames="TripID,MemberID,Trip
Name,Location,Members_present,Guests,Trip Date,Intro,Conditions,Best
Flies,Fishing,Images,Memorable Moments,Awards" s-column="Best Flies"
b-tableformat="TRUE" b-hasHTML="FALSE" clientside startspan b-makelink
b-MenuFormat preview="<font size="-1">&lt;&lt;</font>Best Flies<font
size="-1">&gt;&gt;</font>" --><%=FP_FieldVal(fp_rs,"Best Flies")%><!--webbot
bot="DatabaseResultColumn" endspan i-checksum="28360" --></span></font></td>
</tr><tr>
<td width="99%" colspan="3"><hr></td>
</tr><tr>
<td width="21%"><b><font style="font-size: 11pt" face="Arial" color="#0000FF">
The Fishing</font></b></td>
<td width="78%" colspan="2">
<font face="Arial"><span style="font-size: 11pt">
<!--webbot bot="DatabaseResultColumn" s-columnnames="TripID,MemberID,Trip
Name,Location,Members_present,Guests,Trip Date,Intro,Conditions,Best
Flies,Fishing,Images,Memorable Moments,Awards" s-column="Fishing"
b-tableformat="TRUE" b-hasHTML="FALSE" clientside startspan b-makelink
b-MenuFormat preview="<font size="-1">&lt;&lt;</font>Fishing<font
size="-1">&gt;&gt;</font>" --><%=FP_FieldVal(fp_rs,"Fishing")%><!--webbot
bot="DatabaseResultColumn" endspan i-checksum="12842" --></span></font></td>
</tr><tr>
<td width="99%" colspan="3"><hr></td>
</tr><tr>
<td width="21%"><b><font style="font-size: 11pt" face="Arial"
color="#0000FF">Memorable Moments</font></b></td>
<td width="78%" colspan="2">
<font face="Arial"><span style="font-size: 11pt">
<!--webbot bot="DatabaseResultColumn" s-columnnames="TripID,MemberID,Trip
Name,Location,Members_present,Guests,Trip Date,Intro,Conditions,Best
Flies,Fishing,Images,Memorable Moments,Awards" s-column="Memorable Moments"
b-tableformat="TRUE" b-hasHTML="FALSE" clientside startspan b-makelink
b-MenuFormat preview="<font size="-1">&lt;&lt;</font>Memorable Moments<font
size="-1">&gt;&gt;</font>" --><%=FP_FieldVal(fp_rs,"Memorable
Moments")%><!--webbot bot="DatabaseResultColumn" endspan i-checksum="37234"
--></span></font></td>
</tr><tr>
<td width="99%" colspan="3"><hr></td>
</tr>


<tr>
<td width="21%"><b><font style="font-size: 11pt" face="Arial"
color="#0000FF">Awards</font></b></td>
<td width="78%" colspan="2">
<font face="Arial"><span style="font-size: 11pt">
<!--webbot bot="DatabaseResultColumn" s-columnnames="TripID,MemberID,Trip
Name,Location,Members_present,Guests,Trip Date,Intro,Conditions,Best
Flies,Fishing,Images,Memorable Moments,Awards" s-column="Awards"
b-tableformat="TRUE" b-hasHTML="FALSE" clientside startspan b-makelink
b-MenuFormat preview="<font size="-1">&lt;&lt;</font>Awards<font
size="-1">&gt;&gt;</font>" --><%=FP_FieldVal(fp_rs,"Awards")%><!--webbot
bot="DatabaseResultColumn" endspan i-checksum="16338" --></span></font></td>
</tr>


<tr>
<td width="99%" colspan="3"><hr></td>
</tr>


<tr>
<td width="21%"><b><font style="font-size: 11pt" face="Arial"
color="#0000FF">Image
Group Title</font></b></td>
<td width="78%" colspan="2">
<font face="Arial"><span style="font-size: 11pt">

<!--webbot bot="DatabaseResultColumn" s-columnnames="TripID,MemberID,Trip
Name,Location,Members_present,Guests,Trip Date,Intro,Conditions,Best
Flies,Fishing,Images,Memorable Moments,Awards" s-column="Images"
b-tableformat="TRUE" b-hasHTML="FALSE" clientside startspan b-makelink
b-MenuFormat preview="<font size="-1">&lt;&lt;</font>Images<font
size="-1">&gt;&gt;</font>" --><%=FP_FieldVal(fp_rs,"Images")%><!--webbot
bot="DatabaseResultColumn" endspan i-checksum="15552"
--></a></span></font></td>
</tr>


<tr>
<td width="99%" colspan="3">
</td>
</tr>

</table>

<!--webbot bot="DatabaseRegionEnd" b-tableformat="FALSE"
b-menuformat="FALSE" u-dbrgn2="../../../_fpclass/fpdbrgn2.inc"
i-groupsize="0" clientside Tag="BODY" startspan preview="<table border=0
width="100%"><tr><td bgcolor="#FFFF00"><font color="#000000">This is the end
of a Database Results region.</font></td></tr></table>" --><!--#include
file="../../../_fpclass/fpdbrgn2.inc"-->
<!--webbot bot="DatabaseRegionEnd" endspan i-checksum="9297" -->
<table border="0" width="100%" id="table1">
<tr>
<td><hr></td>
</tr>
<tr>
<td><font face="Arial Rounded MT Bold" size="4" color="#0000FF">Trip
Images</font></td>
</tr>
</table>

<table width="100%" border="0" cellpadding="2" id="table2">
<thead>
<tr>
<th style="color: #FFFFFF" bgcolor="#000000">
<font face="Arial" style="font-size: 11pt">
<span style="font-weight: 400"><b>Image</b></span></font></th>
<th style="color: #FFFFFF" bgcolor="#000000">
<font face="Arial" style="font-size: 11pt">
<span style="font-weight: 400"><b>Location/Trip</b></span></font></th>
<th style="color: #FFFFFF" bgcolor="#000000">
<font face="Arial" style="font-size: 11pt">
<span style="font-weight: 400"><b>Caption</b></span></font></th>
<th style="color: #FFFFFF" bgcolor="#000000">
<font face="Arial" style="font-size: 11pt">
<span style="font-weight: 400"><b>Date</b></span></font></th>
</tr>
</thead>
<tbody>
<!--webbot bot="DatabaseRegionStart"
s-columnnames="PhotoID,MemberID,Location_Trip,Photo,Caption,Description,Date"
s-columntypes="3,3,202,202,202,203,135" s-dataconnection="cville"
b-tableformat="TRUE" b-menuformat="FALSE" s-menuchoice="Caption"
s-menuvalue="Caption" b-tableborder="TRUE" b-tableexpand="TRUE"
b-tableheader="TRUE" b-listlabels="TRUE" b-listseparator="TRUE"
i-listformat="0" b-makeform="TRUE" s-recordsource="Gallery"
s-displaycolumns="Photo,Location_Trip,Caption,Date" s-criteria="[Caption] LK
{Caption} | [Location_Trip] LK {Caption} | [Description] LK {Caption} +"
s-order s-sql="SELECT * FROM Gallery WHERE (location_trip like
(Reports(Images))"" b-procedure="FALSE" clientside suggestedext="asp"
s-defaultfields="Caption=&amp;Caption=&amp;Caption=" s-norecordsfound="No
records returned." i-maxrecords="0" i-groupsize="0" botid="1"
u-dblib="../../../_fpclass/fpdblib.inc"
u-dbrgn1="../../../_fpclass/fpdbrgn1.inc"
u-dbrgn2="../../../_fpclass/fpdbrgn2.inc" tag="TBODY" preview="<tr><td
colspan=64 bgcolor="#FFFF00" width="100%"><font color="#000000">This is the
start of a Database Results region. The page must be fetched from a web
server with a web browser to display correctly; the current web is stored on
your local disk or network.</font></td></tr>" startspan b-UseDotNET="FALSE"
CurrentExt sa-InputTypes="202,202,203" b-DataGridFormat="FALSE"
b-DGridAlternate="TRUE" sa-CritTypes="202,202,203" b-WasTableFormat="TRUE"
b-ReplaceDatabaseRegion="FALSE" --><!--#include
file="../../../_fpclass/fpdblib.inc"-->
<% if 0 then %>
<SCRIPT Language="JavaScript">
document.write("<div style='background: yellow; color: black;'>The Database
Results component on this page is unable to display database content. The
page must have a filename ending in '.asp', and the web must be hosted on a
server that supports Active Server Pages.</div>");
</SCRIPT>
<% end if %>
<%
fp_sQry="SELECT * FROM Gallery WHERE (location_trip like (Reports(Images))"
fp_sDefault="Caption=&Caption=&Caption="
fp_sNoRecords="<tr><td colspan=4 align=""LEFT"" width=""100%"">No records
returned.</td></tr>"
fp_sDataConn="cville"
fp_iMaxRecords=0
fp_iCommandType=1
fp_iPageSize=0
fp_fTableFormat=True
fp_fMenuFormat=False
fp_sMenuChoice="Caption"
fp_sMenuValue="Caption"
fp_sColTypes="&PhotoID=3&MemberID=3&Location_Trip=202&Photo=202&Caption=202&Description=203&Date=135&"
fp_iDisplayCols=4
fp_fCustomQuery=False
BOTID=1
fp_iRegion=BOTID
%>
<!--#include file="../../../_fpclass/fpdbrgn1.inc"-->
<!--webbot bot="DatabaseRegionStart" endspan i-checksum="15065" --><tr>
<td align="left" valign="top">
<font face="Arial" style="font-size: 11pt">
<img border="2"
src="http://68.178.203.233/ffo_cv/cv_images/th<%=FP_FieldLink(fp_rs,"Photo")%>"
width="75"></font></td>
<td align="left" valign="top">
<a href="detail.asp?PhotoID=<%=FP_FieldURL(fp_rs,"PhotoID")%>"
target="_self">

<font face="Arial" style="font-size: 11pt">

<!--webbot bot="DatabaseResultColumn"
s-columnnames="PhotoID,MemberID,Location_Trip,Photo,Caption,Description,Date"
s-column="Caption" b-tableformat="TRUE" b-hashtml="FALSE" b-makelink="FALSE"
clientside b-MenuFormat preview="<font size="-1">&lt;&lt;</font>Caption<font
size="-1">&gt;&gt;</font>" startspan
--><%=FP_FieldVal(fp_rs,"Caption")%><!--webbot bot="DatabaseResultColumn"
endspan i-checksum="11767" --></font></td>
<td align="left" valign="top">

<font face="Arial" style="font-size: 11pt">
<!--webbot bot="DatabaseResultColumn"
s-columnnames="PhotoID,MemberID,Location_Trip,Photo,Caption,Description,Date"
s-column="Location_Trip" b-tableformat="TRUE" b-hashtml="FALSE"
b-makelink="FALSE" clientside b-MenuFormat preview="<font
size="-1">&lt;&lt;</font>Location_Trip<font size="-1">&gt;&gt;</font>"
startspan s-ColumnTypes="3,3,202,202,202,203,135"
--><%=FP_FieldVal(fp_rs,"Location_Trip")%><!--webbot
bot="DatabaseResultColumn" endspan i-checksum="32790" --></font></td>
<td align="left" valign="top">
<font face="Arial" style="font-size: 11pt">
<!--webbot bot="DatabaseResultColumn"
s-columnnames="PhotoID,MemberID,Location_Trip,Photo,Caption,Description,Date"
s-column="Date" b-tableformat="TRUE" b-hashtml="FALSE" b-makelink="FALSE"
clientside b-MenuFormat preview="<font size="-1">&lt;&lt;</font>Date<font
size="-1">&gt;&gt;</font>" startspan
--><%=FP_FieldVal(fp_rs,"Date")%><!--webbot bot="DatabaseResultColumn"
endspan i-checksum="3267" --></font></td>
</tr>
<!--webbot bot="DatabaseRegionEnd" b-tableformat="TRUE"
b-menuformat="FALSE" u-dbrgn2="../../../_fpclass/fpdbrgn2.inc"
i-groupsize="0" clientside tag="TBODY" preview="<tr><td colspan=64
bgcolor="#FFFF00" width="100%"><font color="#000000">This is the end of a
Database Results region.</font></td></tr>" startspan --><!--#include
file="../../../_fpclass/fpdbrgn2.inc"-->
<!--webbot bot="DatabaseRegionEnd" endspan i-checksum="9297" --></tbody>
</table>


</body>

</html>

-----------------------------------------------

Thomas A. Rowe said:
Ok, then in your next query use

"SELECT * FROM OtherDatabase WHERE (image_group = '" & fp_rs1("image_group") & "')"

"fp_rs1" is the name of the first recordset used by your first query, This recordset must have a
unique name.
--
==============================================
Thomas A. Rowe
Microsoft MVP - FrontPage

http://www.Ecom-Data.com
==============================================
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top