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

Microsoft MVP

 

>1 page of results stored in array..?

 
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 >> >1 page of results stored in array..?
Page: [1]
 
proper

 

Posts: 14
Joined: 1/5/2002
From: United Kingdom
Status: offline

 
>1 page of results stored in array..? - 2/12/2003 19:00:04   
I am retrieving > 1 page of results from the DB (page size is set to 5). Presumably the SQL is executed and the results stored in an array somewhere..... Can I see the code that carries out the table loops to produce 5 on a page (is it inside the mysterious include statements?)
My code produces the first page fine and then appears to go back and execute the SQL again (without the form data so different results) before displaying page 2. Also sometimes starts on page 2. I don' t appear to be able to put an IF statement around the SQl code (ie to say if first time thru then execute otherwise don' t and to set abspage to 1 first time thru) - do I need to do this or should the FP code be handling this when I chose 5 recs per page (bit concerned I' ve lost something when administering the spooky diet!)
Thanks
rdouglass

 

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

 
RE: >1 page of results stored in array..? - 2/13/2003 8:33:09   
quote:

Can I see the code that carries out the table loops to produce 5 on a page (is it inside the mysterious include statements?)


Yes, that' s where it is. Can you be more specific about what you' re trying to do? I' m sure someone has done something similar to what you' re trying and there should be a solution around somewhere...:)

I ' wrap' dieted DRW code a lot, but lately haven' t been using DRW much ' cause of the types of issues you' re running into.

(in reply to proper)
proper

 

Posts: 14
Joined: 1/5/2002
From: United Kingdom
Status: offline

 
RE: >1 page of results stored in array..? - 2/13/2003 18:01:56   
Basically a user has the opportunity to select several criteria that must be present for a holiday on a form page and this is used to query an Access DB (within the Web). If a criteria is checked then the record will only be selected if the criteria is present on the DB rec. If a criteria is not checked that doesn' t necessarily exclude the record from selection. No criteria checked will return all recs on the DB (up to a defined limit)
Given that there could potentially be lots of records returned, I want to display 5 recs on a page. I used the DB Results wizard to do this and then used the spooky diet on the code because I wanted to use SQL which wasn' t allowed by custom query in FP (it uses variables I create as well as form fields).

I want to be able to see what is actually happening when it handles the 6th record (ie start of 2nd page of results) because it goes from displaying 5 to 6 of 6 recs on page 1 (correctly) to displaying 6 - 10 of 10 recs on page 2 (rather than 6 - 6 of 6 recs).

(in reply to proper)
rdouglass

 

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

 
RE: >1 page of results stored in array..? - 2/17/2003 11:17:17   
quote:

I want to be able to see what is actually happening


I honestly don' t know how to do that. Unfortunately, this may be the time to move away from the DRW :). That is not necessarily a bad thing, it just may be the only way (at least that I' m aware of). You can check out 1 way to do the ' paging' thing here at 4GuysFromRolla. They have a great ASPFAQ section for this kinda' stuff.

I' f you' re still stuck, can you post some code that we can look at?

(in reply to proper)
proper

 

Posts: 14
Joined: 1/5/2002
From: United Kingdom
Status: offline

 
RE: >1 page of results stored in array..? - 2/19/2003 9:56:50   
Thanks for that reference - certainly have to try that if I can' t get this to work, tho' I' m not quite sure how I' d incorporate it into what I' ve already got ie do I leave out the include statements - all 3 of them?

Anyway here is the code in case you can spot something glaringly obvious...

Thanks

<body>

<table width=" 100%" ><hr>
<tbody>
<!--#include file=" _fpclass/fpdblib.inc" -->


<% if 0 then %>
....stuff about needing to be asp........
<% end if %>

<%
fp_sQry=" SELECT statement.......
fp_sDefault=" "
fp_sNoRecords=" No records have been found which match your search criteria - try altering the criteria"
fp_sDataConn=" HolidayDB1"
fp_iMaxRecords=256
fp_iCommandType=1
fp_iPageSize=5
fp_fTableFormat=True
fp_fMenuFormat=False
fp_sMenuChoice=" Name"
fp_sMenuValue=" Name"
fp_iDisplayCols=4
fp_fCustomQuery=True
BOTID=0
fp_iRegion=BOTID
%>

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

<% rcount=fp_rs.RecordCount %>

<tr>
<td height=40 width=150><font size=" 2" color=blue><%=FP_FieldVal(fp_rs," Name" )%></font></td>
<td height=40 width=100><font size=" 2" > </font><font size=" 2" color=" blue" ><%=FP_FieldVal(fp_rs," Address" )%></font></td>
<td height=40 width=160><font size=" 2" > </font><font size=" 2" color=" blue" ><%=" <a target=_blank href=" " " & FP_FieldLink(fp_rs," Website" ) & " " " >" & FP_FieldVal(fp_rs," Website" ) & " </a>" %></font></td></tr>
<tr><td height=40 valign=top colspan=4><font size=" 2" color=#FF9C4A><%=FP_FieldVal(fp_rs," Description" )%></font></td></tr>

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

<% if not fp_fError AND (fp_iAbsPage*fp_iPageSize)-(fp_iPageSize-1) >0 then response.write " Displaying " & (fp_iAbsPage*fp_iPageSize)-(fp_iPageSize-1) & " -" & ((fp_iAbsPage*fp_iPageSize)-fp_iPageSize)+(fp_iCount) & " of " & rcount & " items." end if %>
</body></html>

(in reply to proper)
Page:   [1]

All Forums >> Web Development >> ASP and Database >> >1 page of results stored in array..?
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