
|
Problem Sorting Recordset By 15 Seconds Discussion List |
Rating: 3.5 out of 5 Rate this article
|
email this article to a colleague
suggest an article
|
Neil Kiser Writes:
I have a recordset that is declared within the ASP page, then passed by
reference to a VB COM object where it is actually created and populated.
After the method of the COM object returns I would like to sort the data
within the recordset, but it seems to have no effect and I receive no error
messages. Does anyone have any suggestions? BTW, sorting at the fetching
point is not ideal in our situation, hence the desire to re-order the
recordset itself.
Thanks for any advice.
Here's the relevant lines of code:
dim clsSearchMgr
dim rsAccount
set rsAccount = server.CreateObject("ADODB.RecordSet")
set clsSearchMgr = Server.CreateObject("CBPWebAccount.Account")
clsSearchMgr.Search(gcookUserID,rsFilter,rsAccount,rsError)
rsAccount.Sort = "ACCTAcctAcctNum"
Rob Chartier Responds With:
You can either specify the sort order in the ORDER BY clause in the sql
statement or use .SORT
You could try to indicate which direction for your sort:
rsAccount.Sort = "ACCTAcctAcctNum ASC"
Neil Rebuts With:
When we do this, we see no effect. We get no error and we get no
satisfaction.
We are using the .sort method. We can't alter our SQL (we could but it is
more trouble than we want to go to right now - this SQL is used by several
other places which would be affected, which means we would need to alter a
lot of code to satisfy one small client request. The .sort method should
allow us to tactically make this change.
Jamie Hornstein Asks:
You don't have OnErrorResumeNext turn on, do you?
That's bitten me more than once :)
I'm not sure just because you pass the recordset to the object, you can
modify and the vbscript reference is still pointing at the same recordset.
I guess everything's byref so it should be. I've never tried it.
What if you turn your object into a function and have it return a recordset,
then sort that?
A Jubilant Neil Shouts:
That was it! We were using the wrong field name (we were using the alias,
but it seems that the .sort method requires the actual field name). Our On
Error Resume Next was masking the error from us, all we knew was that the
final result set was always the same.
Thanks a bunch.
This conversation string was taken from the 15Seconds ASP Listserv on 1/25/01.
If you have an ASP-related question or would like to share some of your knowledge
with others, you may join the list by clicking here.
|
|
|
|
|
Supporting Products/Tools
|
|
|
CustomError 2.0 for IIS
|
|
When errors occur on a Web site, they should be handled in a way that helps the user to get back on track. Unfortunately, setting up customized error pages in IIS usually requires something many Web developers lack -- access to and familiarity with the Web server's administrative interface. With CustomError for IIS, developers can add error pages, coded by hand or created in their favorite editor, by simply uploading them to a designated directory. No administrator intervention is required.
|
[Top]
|
|
|
|
Other Articles
|
|
|
|
|
|
|
Jun 21, 2004 - Using Open Source .NET Tools for Sophisticated Builds
|
|
|
Building an application can be more than pressing F5. With an increasing
number of quality packages being released, developers for the .NET platform now have options to create a very sophisticated build process. Aaron Junod describes a sample build environment and shows how a number of tools can work together to make reliable, predictable, and value-added builds.
[Read This Article] [Top]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Apr 18, 2001 - Error Reporting - IIS 5.0
|
|
|
The script in Mark Newlands' article this week handles how errors are displayed and logged. It can capture all values in use at the time (e.g. form, querystring, session,and application level) and records them if you set a Boolean value to do so - displays custom HTML if required. Sends email, logs to database, and/or text file.
[Read This Article] [Top]
|
|
|
|
|
Mailing List
Want to receive email when the next article is published? Just Click Here to sign up.
|
|