Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_databases thread: Re: ASP - Stored Procedures - Recordsets


Message #1 by "Jonathan Charlton" <jcharlton@e...> on Fri, 5 Jul 2002 09:58:19 +0100
Cheers Ken your a star!!

Jon

-----Original Message-----
From: Ken Schaefer [mailto:ken@a...]
Sent: 05 July 2002 04:05
To: ASP Databases
Subject: [asp_databases] Re: ASP - Stored Procedures - Recordsets


When you do:

Set objRS = objCommand.Execute

you are setting objRS to be a reference to whatever objCommand.Execute
returns. objCommand.Execute is returning a default forward only,
adLockReadOnly, server side cursor.

What you could do is:

<%
objRS.Open objCommand, objConn, adOpenStatic, adLockReadOnly,
adCmdStoredProc
%>

That said, the *easiest* way to hobble a web application is to use cursors
when you don't really need to. I'd seriously suggest that:

a) You build the filtering into the sproc (if possible)
b) use .GetRows to move the recordset data into a VBScript array - which
means you can "scroll" backwards/forwards to your heart's content without
requiring any extra work on the part of your database:

objRS.Open    ....
If not objRS.EOF then
    ' Apply filter if you really need to
    ' Now put data into an array
    arrResults = objRS.GetRows
End If

' Now dispose of recordset:
objRS.Close
Set objRS = nothing



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
From: "Jonathan Charlton" <jcharlton@e...>
Subject: [asp_databases] ASP - Stored Procedures - Recordsets


: Hi all,
:
: Please could somebody assist me by telling me if it is possible (and if
: so how) to create a recordset from a stored procedure that can have the
: position moved both forwards and back. My code at present is:
:
: set SecurityMappingsRS = Server.CreateObject("ADODB.recordset")
: SecurityMappingsRS.CursorType = 3
: set SecurityMappingsRS = objCommand.Execute
:
: But it doesnt seem to be doing the trick. It still moans when I try to do
: a move.previous or a filter.
:
: Any suggestions gratefully received!
:



Message #2 by "Ken Schaefer" <ken@a...> on Fri, 5 Jul 2002 13:04:43 +1000
When you do:

Set objRS = objCommand.Execute

you are setting objRS to be a reference to whatever objCommand.Execute
returns. objCommand.Execute is returning a default forward only,
adLockReadOnly, server side cursor.

What you could do is:

<%
objRS.Open objCommand, objConn, adOpenStatic, adLockReadOnly,
adCmdStoredProc
%>

That said, the *easiest* way to hobble a web application is to use cursors
when you don't really need to. I'd seriously suggest that:

a) You build the filtering into the sproc (if possible)
b) use .GetRows to move the recordset data into a VBScript array - which
means you can "scroll" backwards/forwards to your heart's content without
requiring any extra work on the part of your database:

objRS.Open    ....
If not objRS.EOF then
    ' Apply filter if you really need to
    ' Now put data into an array
    arrResults = objRS.GetRows
End If

' Now dispose of recordset:
objRS.Close
Set objRS = nothing



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
From: "Jonathan Charlton" <jcharlton@e...>
Subject: [asp_databases] ASP - Stored Procedures - Recordsets


: Hi all,
:
: Please could somebody assist me by telling me if it is possible (and if
: so how) to create a recordset from a stored procedure that can have the
: position moved both forwards and back. My code at present is:
:
: set SecurityMappingsRS = Server.CreateObject("ADODB.recordset")
: SecurityMappingsRS.CursorType = 3
: set SecurityMappingsRS = objCommand.Execute
:
: But it doesnt seem to be doing the trick. It still moans when I try to do
: a move.previous or a filter.
:
: Any suggestions gratefully received!
:

Message #3 by "=?iso-8859-1?B?QUpBWK4=?=" <ajax@i...> on Thu, 4 Jul 2002 15:03:25 +0530
include this line in between before execute

SecurityMappingsRS.CursorLocation = 3

shld work
cheers!!!
ajax®.

----- Original Message -----
From: "Jonathan Charlton" <jcharlton@e...>
To: "ASP Databases" <asp_databases@p...>
Sent: Thursday, July 04, 2002 10:08 AM
Subject: [asp_databases] ASP - Stored Procedures - Recordsets


> Hi all,
>
> Please could somebody assist me by telling me if it is possible (and if
> so how) to create a recordset from a stored procedure that can have the
> position moved both forwards and back. My code at present is:
>
> set SecurityMappingsRS = Server.CreateObject("ADODB.recordset")
> SecurityMappingsRS.CursorType = 3
> set SecurityMappingsRS = objCommand.Execute
>
> But it doesnt seem to be doing the trick. It still moans when I try to do
> a move.previous or a filter.
>
> Any suggestions gratefully received!
>
> Cheers
>
> Jon

Message #4 by "Jonathan Charlton" <jcharlton@e...> on Thu, 4 Jul 2002 11:52:17 +0100
That doesnt appear to do the trick!

any other ideas??

-----Original Message-----
From: AJAX® [mailto:ajax@i...]
Sent: 04 July 2002 10:33
To: ASP Databases
Subject: [asp_databases] Re: ASP - Stored Procedures - Recordsets


include this line in between before execute

SecurityMappingsRS.CursorLocation = 3

shld work
cheers!!!
ajax®.

----- Original Message -----
From: "Jonathan Charlton" <jcharlton@e...>
To: "ASP Databases" <asp_databases@p...>
Sent: Thursday, July 04, 2002 10:08 AM
Subject: [asp_databases] ASP - Stored Procedures - Recordsets


> Hi all,
>
> Please could somebody assist me by telling me if it is possible (and if
> so how) to create a recordset from a stored procedure that can have the
> position moved both forwards and back. My code at present is:
>
> set SecurityMappingsRS = Server.CreateObject("ADODB.recordset")
> SecurityMappingsRS.CursorType = 3
> set SecurityMappingsRS = objCommand.Execute
>
> But it doesnt seem to be doing the trick. It still moans when I try to do
> a move.previous or a filter.
>
> Any suggestions gratefully received!
>
> Cheers
>
> Jon




Message #5 by "Jonathan Charlton" <jcharlton@e...> on Thu, 4 Jul 2002 10:08:30
Hi all,

Please could somebody assist me by telling me if it is possible (and if 
so how) to create a recordset from a stored procedure that can have the 
position moved both forwards and back. My code at present is:

set SecurityMappingsRS = Server.CreateObject("ADODB.recordset")
SecurityMappingsRS.CursorType = 3
set SecurityMappingsRS = objCommand.Execute

But it doesnt seem to be doing the trick. It still moans when I try to do 
a move.previous or a filter. 

Any suggestions gratefully received!

Cheers

Jon

  Return to Index