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

 

RE: sorting columns... I know, I know...

 
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 >> RE: sorting columns... I know, I know...
Page: <<   < prev  1 [2]
 
BeTheBall

 

Posts: 6336
Joined: 6/21/2002
From: West Point Utah USA
Status: offline

 
RE: sorting columns... I know, I know... - 1/25/2007 20:31:09   
Take out the single quotes that surround "& Request("SortColumn") &".

fp_sQry="SELECT * FROM viewclasses ORDER BY "& Request("SortColumn") &" ASC"

_____________________________

Duane

Some people are like Slinkies . . . Not really good for anything . . . . . But they still bring a smile to your face when you push them down a flight of stairs.

(in reply to aipnit)
BeTheBall

 

Posts: 6336
Joined: 6/21/2002
From: West Point Utah USA
Status: offline

 
RE: sorting columns... I know, I know... - 1/25/2007 20:41:18   
Terrible answers from me today. This should be the correct line:

fp_sQry="SELECT * FROM viewclasses ORDER BY "& SortColumn &" ASC"

It's worth noting that rdouglas gave the correct answer in his initial post. Moreover, your code would have worked from the beginning were it not for the inherent FP problem covered in the post I referred to above (http://www.frontpagewebmaster.com/m-175524/tm.htm)

< Message edited by BeTheBall -- 1/25/2007 21:40:32 >


_____________________________

Duane

Some people are like Slinkies . . . Not really good for anything . . . . . But they still bring a smile to your face when you push them down a flight of stairs.

(in reply to BeTheBall)
aipnit

 

Posts: 30
Joined: 9/25/2006
Status: offline

 
RE: sorting columns... I know, I know... - 1/26/2007 12:23:23   
Well then, thanks to all those with the dedication and patience for assisting me because....

It is working perfectly now. Even the dates are sorting the correct way!

Love this forum!

THANKS!
AP

< Message edited by aipnit -- 1/26/2007 12:29:20 >

(in reply to BeTheBall)
aipnit

 

Posts: 30
Joined: 9/25/2006
Status: offline

 
RE: sorting columns... I know, I know... - 1/26/2007 13:01:35   
I am so sorry... but unfortunately I do have one more question ... is there a way to have search options on the same page as the results page?

I tried to input some search options and received an error:

Database Results Wizard Error
Description: Syntax error in ORDER BY clause.
Number: -2147217900 (0x80040E14)
Source: Microsoft JET Database Engine

(in reply to aipnit)
aipnit

 

Posts: 30
Joined: 9/25/2006
Status: offline

 
RE: sorting columns... I know, I know... - 1/29/2007 14:15:22   
Duane,

Regarding the sorting columns as discussed, I have added search criteria and now it doesn't work.

I have been looking at the following threads and trying to implement them into my situation, but I haven't come up with a solution.
http://www.frontpagewebmaster.com/m-251079/key-sort%252Ccolumns/tm.htm#251147
http://www.frontpagewebmaster.com/m-183746/key-sort%252Ccolumns/tm.htm#183746

However, because my search criteria doesn't match my result columns, I can't get it to work. I assume that is why. For example, my search is: CARESApplicable, Category, and/or Keyword and my results are: CourseTrainingName, StartDate, ClassDayEve, Location1, CARESApplicable.

Here is my code that I have adjusted from reading the above threads:

<a href="default.asp?SortColumn=CourseTrainingName&CourseTrainingName=<%=Session("CourseTrainingName")%>">
<font color="#0000FF">CourseTrainingName</font></a>
   <a href="default.asp?SortColumn=StartDate&StartDate=<%=Session("StartDate")%>">
   <font color="#0000FF">StartDate</font></a>
<a href="default.asp?SortColumn=ClassDayEve&ClassDayEve=<%=Session("ClassDayEve")%>">
<font color="#0000FF">ClassDayEve</font></a>
   <a href="default.asp?SortColumn=Location1&Location1=<%=Session("Location1")%>">
   <font color="#0000FF">Location1</font></a>
<a href="default.asp?SortColumn=CARESApplicable&CARESApplicable=<%=Session("CARESApplicable")%>">
<font color="0000FF">CARESApplicable</font></a>

<% end if%>
<% 
If Request.Form("CourseTrainingName") <>"" Then 
Session("CourseTrainingName") = Request.Form("CourseTrainingName") 
Else 
Session("CourseTrainingName") = "%" 
End If 
CourseTrainingName= Session("CourseTrainingName") 
%>
<%
fp_sQry="SELECT * FROM viewclasses WHERE (CARESApplicable LIKE '%::CARESApplicable::%' AND Category LIKE '%::Category::%' AND Keyword LIKE '%::Keyword::%') ORDER BY ::SortColumn:: ASC"   
fp_sDefault="SortColumn=CourseTrainingName"
fp_sNoRecords="<tr><td colspan=5 align=""LEFT"" width=""100%"">No records returned.</td></tr>"
fp_sDataConn="CARES_DB"
fp_iMaxRecords=0
fp_iCommandType=1
fp_iPageSize=0
fp_fTableFormat=True
fp_fMenuFormat=False
fp_sMenuChoice=""
fp_sMenuValue=""
fp_sColTypes="&CourseTrainingName=202&StartDate=135&ClassDayEve=202&Location1=202&CARESApplicable=202&"
fp_iDisplayCols=5
fp_fCustomQuery=True
BOTID=0
fp_iRegion=BOTID
%>


The error that comes up is below - I have checked out the MS knowledge base article, but it doesn't seem to apply.

Database Results Wizard Error
Your page contains a query with user input parameters that could not be resolved.
This could happen if your DatabaseRegionStart webbot has an empty or missing s-columnnames or s-columntypes attributes.
You may need to read Microsoft Knowledge Base Article 817029.

One or more form fields were empty. You should provide default values for all form fields that are used in the query.


Thank you again!
AP

(in reply to aipnit)
BeTheBall

 

Posts: 6336
Joined: 6/21/2002
From: West Point Utah USA
Status: offline

 
RE: sorting columns... I know, I know... - 1/29/2007 17:55:09   
I recommend you replace the files in the _fpclass folder with the ones Spooky provided in the 4th post of this thread:

http://www.frontpagewebmaster.com/m-175524/tm.htm

There is an error in the files that were included in post 2000 versions of FP and that error is what is causing the bulk of your problems.

_____________________________

Duane

Some people are like Slinkies . . . Not really good for anything . . . . . But they still bring a smile to your face when you push them down a flight of stairs.

(in reply to aipnit)
aipnit

 

Posts: 30
Joined: 9/25/2006
Status: offline

 
RE: sorting columns... I know, I know... - 1/30/2007 15:54:16   
Duane,

That solved the problem perfectly! That is so weird that MS hasn't had a fix for that other than copying over their own files with older ones... hmm.

Thank you so much.

I honestly hate bothering you more, I know that you are so busy. But I have another problem regarding this issue (that is why I didn't start another thread):

If you go to www.childnet.org/amy you will see how the page pulls up classes/trainings from a database.

However, if you choose something from the drop down or type in a keyword to filter your class choices - the filtered list will come up, but when you click on the column to sort it, it doesn't sort through the filtered classes, it pulls all of them from the database again and sorts those.

Does that make sense?

Here is the code I have right now:


<a href="default.asp?SortColumn=CourseTrainingName">
<font color="#0000FF">CourseTrainingName</font></a></b></th>
<th ALIGN="LEFT"><b>
<a href="default.asp?SortColumn=StartDate">
<font color="#0000FF">StartDate</font></a></b></th>
<th ALIGN="LEFT"><b>
<a href="default.asp?SortColumn=ClassDayEve">
<font color="#0000FF">ClassDayEve</font></a></b></th>
<th ALIGN="LEFT"><b>
<a href="default.asp?SortColumn=Location1&">
<font color="#0000FF">Location1</font></a></b></th>
<th ALIGN="LEFT"><b>
<a href="default.asp?SortColumn=CARESApplicable">
<font color="0000FF">CARESApplicable</font></a></b></th>

fp_sQry="SELECT * FROM viewclasses WHERE (CARESApplicable LIKE '%::CARESApplicable::%' AND Category LIKE '%::Category::%' AND Keyword LIKE '%::Keyword::%') ORDER BY ::SortColumn:: ASC"
fp_sDefault="SortColumn=CourseTrainingName"


(in reply to BeTheBall)
BeTheBall

 

Posts: 6336
Joined: 6/21/2002
From: West Point Utah USA
Status: offline

 
RE: sorting columns... I know, I know... - 1/30/2007 16:41:44   
That is because the links do not include all the parameters that are needed for the SQL statement to properly filter the results. You would need to modify the link as follows:

default.asp?SortColumn=CourseTrainingName&CARESApplicable=<%=Request("CARESApplicable")%>&Category=<%=Request("Category")%>&Keyword=<%=Request("Keyword")%>

You would need to do the same for each column heading. The code is identical for each column except for the value that follows SortColumn=

Make sense?

< Message edited by BeTheBall -- 1/31/2007 16:00:36 >


_____________________________

Duane

Some people are like Slinkies . . . Not really good for anything . . . . . But they still bring a smile to your face when you push them down a flight of stairs.

(in reply to aipnit)
aipnit

 

Posts: 30
Joined: 9/25/2006
Status: offline

 
RE: sorting columns... I know, I know... - 1/31/2007 12:32:03   
Duane:
Yup - it is true... you are awesome!!

I adjusted a couple of typos to make my final links (corresponding differently to each SortColumn=) to:

default.asp?SortColumn=CourseTrainingName&CARESApplicable=<%=Request("CARESApplicable")%>&Category=<%=Request("Category")%>&Keyword=<%=Request("Keyword")%>">

Again... thank you so much! What a great way to end a thread!!

AP

(in reply to BeTheBall)
BeTheBall

 

Posts: 6336
Joined: 6/21/2002
From: West Point Utah USA
Status: offline

 
RE: sorting columns... I know, I know... - 1/31/2007 16:01:33   
Glad you were able to sort through my absent minded typing. :)

_____________________________

Duane

Some people are like Slinkies . . . Not really good for anything . . . . . But they still bring a smile to your face when you push them down a flight of stairs.

(in reply to aipnit)
Page:   <<   < prev  1 [2]

All Forums >> Web Development >> ASP and Database >> RE: sorting columns... I know, I know...
Page: <<   < prev  1 [2]
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