navigation
a webmaster learning community
     Home    Register     Search      Help      Login    
Sponsors

Shopping Cart Software
Ecommerce software integrated into Frontpage, Dreamweaver and Golive templates. No monthly fees and available in ASP and PHP versions.

Website Templates
We also have a wide selection of Dreamweaver, Expression Web and Frontpage templates as well as webmaster tools and CSS layouts.

Frontpage website templates
Creative Website Templates for FrontPage, Dreamweaver, Flash, SwishMax

Search Forums
 

Advanced search
Recent Posts

 Todays Posts
 Most Active posts
 Posts since last visit
 My Recent Posts
 Mark posts read

 

A tweak required with Spookys Grouped Headers

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
Printable Version 

All Forums >> Web Development >> ASP and Database >> A tweak required with Spookys Grouped Headers
Page: [1]
 
RobM_01

 

Posts: 135
Joined: 1/1/2004
Status: offline

 
A tweak required with Spookys Grouped Headers - 5/1/2004 17:10:41   
Can anyone help point me in the right direction to fix this?
I would like to make use of Spookys Group Headers to display the category chosen from a drop down list box to show with the results, but the value shown is a number.

If I use the following code I get the number, which is fine but I want the actual word if possible.


<% 
DIM GroupName,tmpGroupName
GroupName=FP_FieldVal(fp_rs,"CatID") 
If GroupName <> tmpGroupName then 
tmpGroupName=GroupName 
%> 
<td colspan=5><%=tmpGroupName%> </td> 
</tr> 
<tr> 
<%end if%>



This is the field name I want to use but can't get it to work.

		
<% 
DIM GroupName,tmpGroupName
GroupName=FP_FieldVal(fp_rs"CatDesc") 
If GroupName <> tmpGroupName then 
tmpGroupName=GroupName 
%> 
<td colspan=5><%=tmpGroupName%> </td> 
</tr> 
<tr> 
<%end if%>



Below is the form that produces the dynamic drop down, which Betheball and Spooky helped me with a while back to in order to put the worded cats in the list and pass the number value to the results.

	
<form botid="0" method="POST" action="search.asp" name="Form1">
<nobr><p align="right">

<!--#include file="_fpclass/fpdblib.inc"-->

<%
fp_sQry=QSearchCat
fp_sDefault=""
fp_sNoRecords=""
fp_sDataConn="DBConn2"
fp_iMaxRecords=0
fp_iCommandType=1
fp_iPageSize=0
fp_fTableFormat=False
fp_fMenuFormat=True
fp_sMenuChoice="CatDesc"
fp_sMenuValue="CatID"
fp_sColTypes="&CatDesc=202&CatID=3&"
fp_iDisplayCols=2
fp_fCustomQuery=True
BOTID=0
fp_iRegion=BOTID
%> 

<select name="Cat" size="1" onchange="Form1.submit()">

<option></option>
<!--#include file="_fpclass/fpdbrgn1.inc"-->
<option value="<%=FP_FieldHTML(fp_rs,"CatID")%>" <%if request.form("cat") = fp_fieldhtml(fp_rs,"catid") then response.write "selected"%>>
<%=FP_FieldHTML(fp_rs,"CatDesc")%></option>
<!--#include file="_fpclass/fpdbrgn2.inc"-->

</select> 
</p></nobr>
</form>


Cheers Rob.
Spooky

 

Posts: 26606
Joined: 11/11/1998
From: Middle Earth
Status: offline

 
RE: A tweak required with Spookys Grouped Headers - 5/2/2004 14:14:47   
Try :

<%
DIM GroupName,tmpGroupName
GroupName=FP_Field(fp_rs"CatDesc")
If lcase(GroupName) <> lcase(tmpGroupName) then
tmpGroupName=GroupName
%>
<td colspan=5><%=tmpGroupName%> </td>
</tr>
<tr>
<%end if%>

_____________________________

If you arent part of the solution, then there is good money to be made prolonging the problem

§þ:)


(in reply to RobM_01)
RobM_01

 

Posts: 135
Joined: 1/1/2004
Status: offline

 
RE: A tweak required with Spookys Grouped Headers - 5/2/2004 16:56:37   
Hi Spooky,

thanks for the code, I added it as shown below in the coded section but it has failed with the following message:

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

Technical Information (for support personnel)

Error Type:
ADODB.Recordset (0x800A0CC1)
Item cannot be found in the collection corresponding to the requested name or ordinal.
/DIB_Test/_fpclass/fpdblib.inc, line 48


Browser Type:
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.1.4322)

Page:
POST 6 bytes to /DIB_Test/description.asp

POST Data:
Cat=24

Time:
02 May 2004, 21:43:01


More information:
Microsoft Support




<%@ Language=VBScript %> <%

	DIM QSearchCat
	DIM QResultsCat
	
   QSearchCat = "SELECT * FROM tCat ORDER BY CatDesc"
  QResultsCat = "SELECT DISTINCT tCat.CatID, Photo.* FROM ((tCat INNER JOIN tSCat ON tCat.CatID = tSCat.CatID) INNER JOIN tSSCat ON tSCat.SCatID = tSSCat.SCatID) INNER JOIN (Photo INNER JOIN SSC2Photo ON Photo.PhotoID = SSC2Photo.PhotoID) ON tSSCat.SSCatID = SSC2Photo.SSCatID WHERE (((tCat.CatID)=::Cat::)); "

%>
<html>

<head>
<meta name="GENERATOR" content="Microsoft FrontPage 6.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Description</title>
</head>

<body>

<form botid="0" method="POST" action="description.asp" name="Form1">
	<nobr>
	<p align="right">
	<!--#include file="_fpclass/fpdblib.inc"--><%
fp_sQry=QSearchCat
fp_sDefault=""
fp_sNoRecords=""
fp_sDataConn="DBConn2"
fp_iMaxRecords=0
fp_iCommandType=1
fp_iPageSize=0
fp_fTableFormat=False
fp_fMenuFormat=True
fp_sMenuChoice="CatDesc"
fp_sMenuValue="CatID"
fp_sColTypes="&CatDesc=202&CatID=3&"
fp_iDisplayCols=2
fp_fCustomQuery=True
BOTID=0
fp_iRegion=BOTID
%> <select name="Cat" size="1" onchange="Form1.submit()">
	<option></option>
	<!--#include file="_fpclass/fpdbrgn1.inc"-->
	<option value="<%=FP_FieldHTML(fp_rs,"CatID")%>" <%if request.form("cat") = fp_fieldhtml(fp_rs,"catid") then response.write "selected"%>>
	<%=FP_FieldHTML(fp_rs,"CatDesc")%></option>
	<!--#include file="_fpclass/fpdbrgn2.inc"--></select> </p>
	</nobr>
</form>
<table width="100%" border="0" id="tblPhotosFromCat" cellpadding="3" cellspacing="1">
	<tr>
		<td>
		<p>Description</p>
		</td>
		<td>
		<p>Photographer</p>
		</td>
		<td>
		<p>Date taken</p>
		</td>
		<td>
		<p>Original File size</p>
		</td>
		<td>
		<p>Image</p>
		</td>
	</tr>
	<!--#include file="_fpclass/fpdblib.inc"--><%
fp_sQry=QResultsCat
fp_sDefault=""
fp_sNoRecords="<tr><td colspan=5 align=""LEFT"" width=""100%""></td></tr>"
fp_sDataConn="DBConn2"
fp_iMaxRecords=0
fp_iCommandType=1
fp_iPageSize=4
fp_fTableFormat=True
fp_fMenuFormat=False
fp_sMenuChoice=""
fp_sMenuValue=""
fp_sColTypes="&CatID=3&PDesc=202&Filename=202&PhotoID=3&PhotogID=3&Date=135&Size=202&"
fp_iDisplayCols=5
fp_fCustomQuery=True
BOTID=0
fp_iRegion=BOTID
%>
	<!--#include file="_fpclass/fpdbrgn1.inc"-->

	
	<% 
DIM GroupName,tmpGroupName 
GroupName=FP_FieldVal(fp_rs,"CatDesc") 
If lcase(GroupName) <> lcase(tmpGroupName) then 
tmpGroupName=GroupName 
%> 
<td colspan=5><%=tmpGroupName%> </td> 
</tr> 
<tr> 
<%end if%> 

	
<tr>
<td><%=FP_FieldVal(fp_rs,"PDesc")%></td>
<td><%=FP_FieldVal(fp_rs,"PhotogID")%></td>
<td><%=FP_FieldVal(fp_rs,"Date")%></td>
<td><%=FP_FieldVal(fp_rs,"Size")%></td>
<td><%=FP_FieldVal(fp_rs,"Filename")%></td>
</tr>
	<!--#include file="_fpclass/fpdbrgn2.inc"-->
</table>

</body>

</html>





Cheers Rob.

(in reply to RobM_01)
Spooky

 

Posts: 26606
Joined: 11/11/1998
From: Middle Earth
Status: offline

 
RE: A tweak required with Spookys Grouped Headers - 5/2/2004 18:20:20   
Does "CatDesc" exist in "photo.*" ?
In the query QResultsCat, you only use tCat.CatID it seems and not CatDesc

_____________________________

If you arent part of the solution, then there is good money to be made prolonging the problem

§þ:)


(in reply to RobM_01)
RobM_01

 

Posts: 135
Joined: 1/1/2004
Status: offline

 
RE: A tweak required with Spookys Grouped Headers - 5/2/2004 19:40:19   
yes thats right, CatDesc does not exist in the table photos.
I just thought mabe it could somehow be taken from the form that queries
tCat at the beginning where it does exist.

Is it not possible to do this?

(in reply to RobM_01)
Spooky

 

Posts: 26606
Joined: 11/11/1998
From: Middle Earth
Status: offline

 
RE: A tweak required with Spookys Grouped Headers - 5/2/2004 20:09:29   
You really want to pull it from the database

QResultsCat = "SELECT DISTINCT tCat.CatID, tCat.CatDesc, Photo.*

_____________________________

If you arent part of the solution, then there is good money to be made prolonging the problem

§þ:)


(in reply to RobM_01)
Page:   [1]

All Forums >> Web Development >> ASP and Database >> A tweak required with Spookys Grouped Headers
Page: [1]
Jump to: 1





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts