a webmaster learning community
     Home    Register     Search      Help      Login    
FrontPage Alternative
Sponsors

Hosting from $3.99 per month!

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

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

 

Title lines

 
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 >> Title lines
Page: [1]
 
Chriswilks

 

Posts: 30
From: Milton Keynes United Kingdom
Status: offline

 
Title lines - 11/8/2001 20:30:00   
Hi all,

I have a DRW that returns more rows than will fit on the screen without scrolling. I would like to avoid limiting the number of records displayed and using the next page buttons.

Is there any way to make frontpage insert the title line every 20 rows or so?

rdouglass

 

Posts: 9280
From: Biddeford, ME USA
Status: offline

 
RE: Title lines - 11/8/2001 20:25:00   
You should be able to do it. You'll first have to put the DRW on a diet (search the forum here for diet).

Then I think something to the effect:

<% DIM x
x = 0
<!--#include file="_fpclass/fpdbrgn1.inc"-->
<%
IF x < 20
(Code to build table heading)
x = x + 1
ELSE
x = 0
END IF

(DRW Results Code)

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


(in reply to Chriswilks)
Chriswilks

 

Posts: 30
From: Milton Keynes United Kingdom
Status: offline

 
RE: Title lines - 11/9/2001 20:51:00   
Thanks, I think I get the idea.

One question though if the HTML for the table is like

<tr>
<td><b>Vendor</b></td>
<td><b>Type</b></td>
<td><b>Sku</b></td>
<td><b>Product</b></td>
</tr>

etc

How do I separate the IF x < 20 before it. I tried %> but it said that expected a function. Sorry to ask a fill in the blanks question. Are there any web references for learning the basics of VBscript?


(in reply to Chriswilks)
Chriswilks

 

Posts: 30
From: Milton Keynes United Kingdom
Status: offline

 
RE: Title lines - 11/9/2001 20:20:00   
Thanks, I think I get the idea.

One question though if the HTML for the table is like

<tr>
<td><b>Vendor</b></td>
<td><b>Type</b></td>
<td><b>Sku</b></td>
<td><b>Product</b></td>
</tr>

etc

How do I separate the IF x < 20 before it. I tried %> but it said that expected a function. Sorry to ask a fill in the blanks question. Are there any web references for learning the basics of VBscript?


(in reply to Chriswilks)
rdouglass

 

Posts: 9280
From: Biddeford, ME USA
Status: offline

 
RE: Title lines - 11/9/2001 20:08:00   
It should probably look something like:
(Sorry, I left a few things out!!)

<!--#include file="_fpclass/fpdblib.inc"-->
<%
fp_sQry="SELECT * FROM myDB ORDER BY Vendor ASC"
fp_sDefault=""
fp_sNoRecords="No records returned."
fp_sDataConn="myDSN"
fp_iMaxRecords=0
fp_iCommandType=1
fp_iPageSize=0
fp_fTableFormat=False
fp_fMenuFormat=False
fp_sMenuChoice=""
fp_sMenuValue=""
fp_iDisplayCols=3
fp_fCustomQuery=False
BOTID=0
fp_iRegion=BOTID
%>

<% DIM x
x = 0 %>

<!--#include file="_fpclass/fpdbrgn1.inc"-->
<%
IF x = 20 %>

<tr>
<td><b>Vendor</b></td>
<td><b>Type</b></td>
<td><b>Sku</b></td>
<td><b>Product</b></td>
</tr>

<%
x = x + 1
ELSE
x = 0
END IF%>

<tr>
<td><b><%=FP_FieldVal(fp_rs,"Vendor")%></b></td>
<td><b><%=FP_FieldVal(fp_rs,"Type")%></b></td>
<td><b><%=FP_FieldVal(fp_rs,"Sku")%></b></td>
<td><b><%=FP_FieldVal(fp_rs,"Product")%></b></td>
</tr>

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

This is what I suspect it should look like. Have not tested this code for you so syntax may not be exactly correct. The stuff in bold is the stuff you should add to your DRW. The rest of the stuff should look similar to what is there already.

Remember, you'll need to put the page on a diet for this to work...


(in reply to Chriswilks)
Chriswilks

 

Posts: 30
From: Milton Keynes United Kingdom
Status: offline

 
RE: Title lines - 11/9/2001 20:22:00   
Thanks rdouglass

I'm pretty sure I've keyed it all in right but it gives a VBscript error like

Expected 'Then'

/cheatdata/test/results.asp, line 54

IF y = 20
---------^

I've changed the letter to y as i'm using x just below to alternate the line colours


(in reply to Chriswilks)
Chriswilks

 

Posts: 30
From: Milton Keynes United Kingdom
Status: offline

 
RE: Title lines - 11/9/2001 20:27:00   
Talk about look before you leap

I put a then in after y = 20 and the error went away but it doesn't do the insert of the title line every 20 rows. Any thoughts?


(in reply to Chriswilks)
Chriswilks

 

Posts: 30
From: Milton Keynes United Kingdom
Status: offline

 
RE: Title lines - 11/9/2001 23:13:00   
Talk about look before you leap

I put a then in after y = 20 and the error went away but it doesn't do the insert of the title line every 20 rows. Any thoughts?


(in reply to Chriswilks)
rdouglass

 

Posts: 9280
From: Biddeford, ME USA
Status: offline

 
RE: Title lines - 11/9/2001 13:06:00   
Sorry, 'bout that. As I said, I had not tested it and obviously should have! I had some backwards logic in there - you would have NEVER got to 20 in that logic. I set one up on my own page with different parameters. This is a little test DB I use so I had it repeat the table heading every 2 records. Just adjust parameters to fit your environment. This is just the table code with DRW on a diet...

<table width="100%" border="1">
<thead>
<tr>
<td><b>Make</b></td>
<td><b>Model</b></td>
<td><b>ModelNumber</b></td>
<td><b>Color</b></td>
</tr>
</thead>
<tbody>
<%
DIM x
x = 0
%>

<!--#include file="_fpclass/fpdblib.inc"-->
<%
fp_sQry="SELECT * FROM Cars ORDER BY Make ASC"
fp_sDefault=""
fp_sNoRecords="<tr><td colspan=4 align=left width=""100%"">No records returned.</td></tr>"
fp_sDataConn="colorTest"
fp_iMaxRecords=0
fp_iCommandType=1
fp_iPageSize=0
fp_fTableFormat=True
fp_fMenuFormat=False
fp_sMenuChoice=""
fp_sMenuValue=""
fp_iDisplayCols=4
fp_fCustomQuery=False
BOTID=0
fp_iRegion=BOTID
%>
<!--#include file="_fpclass/fpdbrgn1.inc"-->
<%
IF x = 2 THEN%>
<tr>
<td><b>Make</b></td>
<td><b>Model</b></td>
<td><b>Model Number</b></td>
<td><b>Color</b></td>
</tr>
<%
x = 0
END IF%>

<tr>
<td><%=FP_FieldVal(fp_rs,"Make")%></td>
<td><%=FP_FieldVal(fp_rs,"Model")%></td>
<td><%=FP_FieldVal(fp_rs,"ModelNumber")%></td>
<td><%=FP_FieldVal(fp_rs,"Color")%></td>
</tr>
<% x = x + 1 %>
<!--#include file="_fpclass/fpdbrgn2.inc"-->
</tbody>
</table>

Hope this helps....

EDIT: Can't spell....

[This message has been edited by rdouglass (edited 11-09-2001).]


(in reply to Chriswilks)
Chriswilks

 

Posts: 30
From: Milton Keynes United Kingdom
Status: offline

 
RE: Title lines - 11/16/2001 20:11:00   
Hi

sorry for getting back to you so late with a reply, but I have been away for a while. Thanks for that code, it worked a treat.

Thanks

Chris


(in reply to Chriswilks)
Page:   [1]
OutFront Discoveries

All Forums >> Web Development >> ASP and Database >> Title lines
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