Re: resorting recordset returned from SQL stroed procedure
- From: sanmagoo@xxxxxxxxxx
- Date: Mon, 28 Jan 2008 09:02:31 -0800 (PST)
On Jan 28, 11:35 am, "Richard Mueller [MVP]" <rlmueller-
nos...@xxxxxxxxxxxxxxxxxxxx> wrote:
<sanma...@xxxxxxxxxx> wrote in message
news:b23314f2-7e8b-441d-abda-1d0903b140ee@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
I have a stored procedure on a SQL server 2005 database. Application
accessing it is a VB6 program. The app returns the records fine. What
I would llike to do is after the recordset gets returned is to resort
it to one of the columns returned. Data is currently being sorted from
stored procedure by order date. It being a stored procedure, that is
being used by several different apps, I can't change it on server.
I have defined recordset CursorLocationto be adUseClient
This is the two lines setting recordset (in this case rsNotPicked)
rsNotPicked.CursorLocation = adUseClient
rsNotPicked.Open m_cmdQuery, , adOpenStatic, adLockReadOnly
'EXECUTES the stored procedure
At this point I can step through records with
Do While Not rsNotPicked.EOF
MsgBox rsNotPicked.Fields("item Description")
rsNotPicked.MoveNext
Loop
The message box is the field I would like to resort by
when I try to execute
rsNotPicked.Sort = "item description ASC"
I get error Run-Time 3001
Arguments are of the wrong type, are out of range,or are in conflict
with one another.
I can use the sort method with simple select statements, but using the
stored procedure recordset I am struggling with.
ANy help would be most appreciated.
I wonder if the space in the field name confuses things. I would try:
rsNotPicked.Sort = "[item description] ASC"
--
Richard Mueller
Microsoft MVP Scripting and ADSI
Hilltop Lab -http://www.rlmueller.net
--- Hide quoted text -
- Show quoted text -
Thank you. That did it and I am sooooooo damn grateful.
.
- Follow-Ups:
- Re: resorting recordset returned from SQL stroed procedure
- From: Richard Mueller [MVP]
- Re: resorting recordset returned from SQL stroed procedure
- References:
- resorting recordset returned from SQL stroed procedure
- From: sanmagoo
- Re: resorting recordset returned from SQL stroed procedure
- From: Richard Mueller [MVP]
- resorting recordset returned from SQL stroed procedure
- Prev by Date: Re: resorting recordset returned from SQL stroed procedure
- Next by Date: Re: resorting recordset returned from SQL stroed procedure
- Previous by thread: Re: resorting recordset returned from SQL stroed procedure
- Next by thread: Re: resorting recordset returned from SQL stroed procedure
- Index(es):
Relevant Pages
|