[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

Question
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

6.2

Alphabetical Recordset Navigation/Index

Asked by Corrupticus in Adobe Dreamweaver

Tags: letters, navigation, recordset

I have an dreaweaver-built ASP page that displays the results of an access DB via the recordset derived from a DB query. My asp page has buttons that sort (via URL params) the Access DB results by column name - using order by ASC or DESC. I page through the recordset at 15 records per page.

They way the numeric paging works now is that when the next/previous page is clicked on there's a variable called offset that gets appended to the URL that changes with the page #. For instance, when the page first loads (page 1) the offset is 0. For the next page (page 2) with the next set of records, the offset is 15, the next page offset is 30 (in line with the 15 results per page setup) and so forth.

When a user sorts the results of the DB by the column "company", for instance, they have keep paging thru the recordset to get to a company beginning with a certain letter. Even though the results can be sorted ASC or DESC, a user still has to keep flipping thru the pages to get to a company whose name begins with say letter "J". What I'd like to do is create an alphabetical index at the bottom of the ASP page, underneath the numeric page numbers, that allows users to click on a given letter (e.g. "J") and have them taken to the section of the recordset with companies that begin with letter "J"

This way I I have the offset/page jumping to wherever wherever it is in the recordset that the company starts with "J" or whatever letter has been clicked on. The offset for letter "J" is offset 201 (page 14) - which displays the results for companies that begin with J and whatever else follows in the recordset. The user can then keep paging thru the recordset numerically (using the pages) if they choose to, to see the next set of records - any left-over Js & K's and beyond.

Hardcoding the offsets to the letters would not be very feasible in the long-run b/c if new records are added, the offsets will surely change, and will no longer be accurate. Is there any way to programmatically assign a letter to an offset/page #, such that when the letter is clicked on, the user can "jump" to the section of the recordset where the records begin with the clicked on letter?

Any assistance with this (esp with examples) will greatly be appreciated!

I've included the numeric paging code (a dreamweaver extension by tom muck) which might be useful in helping to see how the paging (and use of offset) works:

VARIABLES USED IN THE CODE:
MM_Size = rsProposals_numRows
rsProposals_numRows = rsProposals_numRows + Repeat1_numRows
Repeat1_numRows = 15  'i.e. 15 records per page

MM_keepMove basically keeps track of what URL parameters are to be maintained - in this case the DB column to be sorted by and the direction of sort - ASC or DESC

Note: 9 pages are displayed at a go - i.e. one can choose to view/browse the results of up to 9 pages at a go

'This section shows/navigates back to the Previous 9 pages
<%
If MM_offset > MM_size * 9 Or MM_offset/MM_size - int(9/2) > 0 Then
    TFM_Previous = MM_offset - 10 * MM_size
   If TFM_Previous < 0 then TFM_Previous = 0  
    Response.Write(".<a href=""" & Request.ServerVariables("URL") & "?" & MM_keepMove & "offset=" & TFM_Previous & """>")
   Response.Write("Previous " & "9" & " pages</a> ")
End If
%>

''This section shows the current 9 pages a viewer can click on to view results for : i.e. e.g. -> 10 11 12 13 14 15 16 17 18
<%
TFM_MiddlePages = 9  ' # of pages to be displayed at a time
TFM_delimiter = " "    ' a space separates the page #s
TFM_startLink = MM_offset + 1 - MM_size * (int(TFM_middlePages/2))
If MM_offset > 0 Then TFM_LimitPageEndCount = int(TFM_startLink/MM_size)
If TFM_startLink < 1 Then
     TFM_startLink = 1
    TFM_LimitPageEndCount = 0
End If
TFM_endLink = MM_size * TFM_MiddlePages + TFM_startLink - 1
If TFM_endLink > rsProposals_total Then TFM_endLink = rsProposals_total
For i = TFM_startLink to TFM_endLink Step MM_size
 TFM_LimitPageEndCount = TFM_LimitPageEndCount + 1
 if i <> MM_offset + 1 Then
   Response.Write("<a href=""" & Request.ServerVariables("URL") & "?" & MM_keepMove & "offset=" & i-1 & """>")
   Response.Write(TFM_LimitPageEndCount & "</a>")
 else
   Response.Write("<font color='#FF0000'> ")  ' change color of currently displayed page (which is now unclickable)
    Response.Write(TFM_LimitPageEndCount & "</font> ")
 End if
 if(i <= TFM_endLink - MM_size) then Response.Write(TFM_delimiter)
Next
%>

'This section shows/navigates to the Next 9 pages
<%
If MM_offset < rsProposals_total - MM_size * 9 Then
    Response.Write(" <a href=""" & Request.ServerVariables("URL") & "?" & MM_keepMove & "offset=" & (MM_offset + 9*MM_size) & """>")
   Response.Write("Next " & "9" & " of " & rsProposals_TFMtotalPages & " pages</a> ")
End If
%>

The actual paging text displayed on the ASP page looks something like:

 1 2 3 4 5 6 7 8 9   Next 9 of 26 pages  ' for offset = 0 -> 1 is colored red (#FF0000) and is unclickable
.Previous 9 pages   3 4 5 6 7 8 9 10 11   Next 9 of 26 pages  ' for offset = 90 -> 7 is colored red and unclickable now
.Previous 9 pages   21 22 23 24 25 26   ' for offset = 375 - the last of the records in the recordset -> 26 is red & unclickable

Hope this helps!
[+][-]08/05/03 10:40 AM, ID: 9082279Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08/05/03 01:35 PM, ID: 9083583Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08/06/03 03:11 AM, ID: 9088811Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08/06/03 08:19 AM, ID: 9091902Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08/07/03 04:15 AM, ID: 9098602Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08/07/03 04:20 AM, ID: 9098627Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08/07/03 04:21 AM, ID: 9098633Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08/08/03 08:32 PM, ID: 9112691Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09/06/03 11:23 AM, ID: 9302126Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09/08/03 09:10 AM, ID: 9310333Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09/08/03 12:19 PM, ID: 9311446Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]01/19/04 11:07 PM, ID: 10153019Administrative Comment

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 30-day free trial to view this Administrative Comment or ask the Experts your question.

 
[+][-]03/20/04 11:17 PM, ID: 10643127Administrative Comment

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 30-day free trial to view this Administrative Comment or ask the Experts your question.

 
[+][-]03/24/04 10:10 AM, ID: 10670052Accepted Solution

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

About this solution

Zone: Adobe Dreamweaver
Tags: letters, navigation, recordset
Sign Up Now!
Solution Provided By: CetusMOD
Participating Experts: 3
Solution Grade: A
 
 
Loading Advertisement...
20091021-EE-VQP-81