p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


  Return to Index  

asp_databases thread: Stored Procedure and Recordset Types


Message #1 by Pritesh Mehta <Pritesh.Mehta@h...> on Thu, 14 Dec 2000 16:32:55 -0000
Hi, 



I'm trying to alter the type of recordset returned from a SQL 7.0 Stored



Procedure.



How do I change the LockType, CursorType and Options?



any help/suggestions/sample code would be greatly appreciated



many thanks



Pritesh



**********************************************************************

This email and any files transmitted with it are confidential and 

intended solely for the use of the individual or entity to whom they   

are addressed. If you have received this email in error please notify 

the system manager.



This footnote also confirms that this email message has been swept by 

MIMEsweeper for the presence of computer viruses.



www.mimesweeper.com

**********************************************************************



--- 

FREE SOFTWARE DEVELOPMENT CODE, CONTENT, AND

INSIGHTS IN YOUR INBOX!

Get the latest and best C++, Visual C++, Java, Visual Basic, and XML tips, tools, and 

developments from the experts.  Sign up for one or more of EarthWeb?s

FREE IT newsletters at http://www.earthweb.com today!  

---

You are currently subscribed to asp_databases as: $subst('Recip.EmailAddr')

To unsubscribe send a blank email to leave-asp_databases-$subst('Recip.MemberIDChar')@p2p.wrox.com

Message #2 by Imar Spaanjaars <Imar@S...> on Thu, 14 Dec 2000 18:08:58 +0100
I don't think you can. AFAIK, the execute method will always return a 

read-only and forward-only recordset.



Also see http://msdn.microsoft.com/library/psdk/dasdk/mdat7kv8.htm where 

this is mentioned.



HtH



Imar













At 05:01 PM 12/14/2000 -0800, you wrote:

>Hi,

>

>I'm trying to alter the type of recordset returned from a SQL 7.0 Stored

>

>Procedure.

>

>How do I change the LockType, CursorType and Options?

>

>any help/suggestions/sample code would be greatly appreciated

>

>many thanks

>

>Pritesh

>



---

FREE WEB DEVELOPMENT CODE, CONTENT, AND INSIGHTS

IN YOUR INBOX!

Get the latest and best HTML, XML, and JavaScript tips, tools, and 

developments from the experts.  Sign up for one or more of EarthWeb's

FREE IT newsletters at http://www.earthweb.com today!  

---

You are currently subscribed to asp_databases as: $subst('Recip.EmailAddr')

To unsubscribe send a blank email to leave-asp_databases-$subst('Recip.MemberIDChar')@p2p.wrox.com

Message #3 by "Michael Wong \(Supernet\)" <go2net@p...> on Fri, 15 Dec 2000 22:49:55 +0800
Hello Pritesh,



Try this...



Set oCmd = Server.CreateObject("ADODB.Command")

oConn.Open Application("DSN")

Set oData = Server.CreateObject("ADODB.Recordset")



With oCmd

   .ActiveConnection = oConn

   .CommandType = adCmdStoredProc

   .CommandText = strStoredProc

End With



oData.Open oCmd, , adOpenDynamic, adLockOptimistic



The trick is to use the COMMAND object as source to OPEN the recordset.



Cheers.



Michael Wong











----- Original Message -----

From: "Pritesh Mehta" <Pritesh.Mehta@h...>

To: "ASP Databases" <asp_databases@p...>

Sent: Friday, December 15, 2000 9:01 AM

Subject: [asp_databases] Stored Procedure and Recordset Types





> Hi,

>

> I'm trying to alter the type of recordset returned from a SQL 7.0 Stored

>

> Procedure.

>

> How do I change the LockType, CursorType and Options?

>

> any help/suggestions/sample code would be greatly appreciated

>

> many thanks

>

> Pritesh

>









--- 

NEED TECHNICAL TIPS, TOOLS, AND INSIGHTS?  Is FREE okay?

Visit EarthWeb for the latest in IT Management, Software Development, 

Web Development, Networking & Communications, and Hardware & Systems.  

Click on http://www.earthweb.com for FREE articles, tutorials,

and discussions from the experts.

---

You are currently subscribed to asp_databases as: $subst('Recip.EmailAddr')

To unsubscribe send a blank email to leave-asp_databases-$subst('Recip.MemberIDChar')@p2p.wrox.com

Message #4 by Pritesh Mehta <Pritesh.Mehta@h...> on Mon, 18 Dec 2000 09:28:14 -0000
Thank you, 



Does this mean I can still pass parameters to the Stored Procedure??



Pritesh



-----Original Message-----

From: Michael Wong (Supernet) [mailto:go2net@p...]

Sent: 15 December 2000 14:50

To: ASP Databases

Subject: [asp_databases] Re: Stored Procedure and Recordset Types





Hello Pritesh,



Try this...



Set oCmd = Server.CreateObject("ADODB.Command")

oConn.Open Application("DSN")

Set oData = Server.CreateObject("ADODB.Recordset")



With oCmd

   .ActiveConnection = oConn

   .CommandType = adCmdStoredProc

   .CommandText = strStoredProc

End With



oData.Open oCmd, , adOpenDynamic, adLockOptimistic



The trick is to use the COMMAND object as source to OPEN the recordset.



Cheers.



Michael Wong











----- Original Message -----

From: "Pritesh Mehta" <Pritesh.Mehta@h...>

To: "ASP Databases" <asp_databases@p...>

Sent: Friday, December 15, 2000 9:01 AM

Subject: [asp_databases] Stored Procedure and Recordset Types





> Hi,

>

> I'm trying to alter the type of recordset returned from a SQL 7.0 Stored

>

> Procedure.

>

> How do I change the LockType, CursorType and Options?

>

> any help/suggestions/sample code would be greatly appreciated

>

> many thanks

>

> Pritesh

>







--- 

FREE SOFTWARE DEVELOPMENT CODE, CONTENT, AND

INSIGHTS IN YOUR INBOX!

Get the latest and best C++, Visual C++, Java, Visual Basic, and XML tips, tools, and 

developments from the experts.  Sign up for one or more of EarthWeb?s

FREE IT newsletters at http://www.earthweb.com today!  

---

You are currently subscribed to asp_databases as: $subst('Recip.EmailAddr')

To unsubscribe send a blank email to leave-asp_databases-$subst('Recip.MemberIDChar')@p2p.wrox.com

Message #5 by "Michael Wong \(Supernet\)" <go2net@p...> on Mon, 18 Dec 2000 19:10:51 +0800
> Does this mean I can still pass parameters to the Stored Procedure??



Yes, sure!



Cheers



Michael





----- Original Message -----

From: "Pritesh Mehta" <Pritesh.Mehta@h...>

To: "ASP Databases" <asp_databases@p...>

Sent: Monday, December 18, 2000 5:28 PM

Subject: [asp_databases] Re: Stored Procedure and Recordset Types





> Thank you,

>

> Does this mean I can still pass parameters to the Stored Procedure??

>

> Pritesh

>

> -----Original Message-----

> From: Michael Wong (Supernet) [mailto:go2net@p...]

> Sent: 15 December 2000 14:50

> To: ASP Databases

> Subject: [asp_databases] Re: Stored Procedure and Recordset Types

>

>

> Hello Pritesh,

>

> Try this...

>

> Set oCmd = Server.CreateObject("ADODB.Command")

> oConn.Open Application("DSN")

> Set oData = Server.CreateObject("ADODB.Recordset")

>

> With oCmd

>    .ActiveConnection = oConn

>    .CommandType = adCmdStoredProc

>    .CommandText = strStoredProc

> End With

>

> oData.Open oCmd, , adOpenDynamic, adLockOptimistic

>

> The trick is to use the COMMAND object as source to OPEN the recordset.

>

> Cheers.

>

> Michael Wong

>

>

>

>

>

> ----- Original Message -----

> From: "Pritesh Mehta" <Pritesh.Mehta@h...>

> To: "ASP Databases" <asp_databases@p...>

> Sent: Friday, December 15, 2000 9:01 AM

> Subject: [asp_databases] Stored Procedure and Recordset Types

>

>

> > Hi,

> >

> > I'm trying to alter the type of recordset returned from a SQL 7.0 Stored

> >

> > Procedure.

> >

> > How do I change the LockType, CursorType and Options?

> >

> > any help/suggestions/sample code would be greatly appreciated

> >

> > many thanks

> >

> > Pritesh

> >

>

>

>



---

FREE WEB DEVELOPMENT CODE, CONTENT, AND INSIGHTS

IN YOUR INBOX!

Get the latest and best HTML, XML, and JavaScript tips, tools, and 

developments from the experts.  Sign up for one or more of EarthWeb's

FREE IT newsletters at http://www.earthweb.com today!  

---

You are currently subscribed to asp_databases as: $subst('Recip.EmailAddr')

To unsubscribe send a blank email to leave-asp_databases-$subst('Recip.MemberIDChar')@p2p.wrox.com

Message #6 by "Dallas Martin" <dmartin@z...> on Mon, 18 Dec 2000 20:29:44 -0500
Here's the syntax:



' create command object

Set CMD = Server.CreateObject("ADODB.Command")



'** FOR EACH PARAMETER

Set oParam = CMD.CreateParameter

oParam.Name = "parameter1"

oParam.Type = adTypeInteger 'enum types given in ADOVBS.INC

oParam.Direction = adParameterDirectionInput ' input as oppose to output

oParam.Value = 1000 ' or string, or date or whatever



' add to CMD object

CMD.Parameters.Add oParam



DONT FORGET THE CONNECTION string



hth,

Dallas Martin







----- Original Message -----

From: "Pritesh Mehta" <Pritesh.Mehta@h...>

To: "ASP Databases" <asp_databases@p...>

Sent: Monday, December 18, 2000 4:28 AM

Subject: [asp_databases] Re: Stored Procedure and Recordset Types





> Thank you,

>

> Does this mean I can still pass parameters to the Stored Procedure??

>

> Pritesh

>

> -----Original Message-----

> From: Michael Wong (Supernet) [mailto:go2net@p...]

> Sent: 15 December 2000 14:50

> To: ASP Databases

> Subject: [asp_databases] Re: Stored Procedure and Recordset Types

>

>

> Hello Pritesh,

>

> Try this...

>

> Set oCmd = Server.CreateObject("ADODB.Command")

> oConn.Open Application("DSN")

> Set oData = Server.CreateObject("ADODB.Recordset")

>

> With oCmd

>    .ActiveConnection = oConn

>    .CommandType = adCmdStoredProc

>    .CommandText = strStoredProc

> End With

>

> oData.Open oCmd, , adOpenDynamic, adLockOptimistic

>

> The trick is to use the COMMAND object as source to OPEN the recordset.

>

> Cheers.

>

> Michael Wong

>

>

>

>

>

> ----- Original Message -----

> From: "Pritesh Mehta" <Pritesh.Mehta@h...>

> To: "ASP Databases" <asp_databases@p...>

> Sent: Friday, December 15, 2000 9:01 AM

> Subject: [asp_databases] Stored Procedure and Recordset Types

>

>

> > Hi,

> >

> > I'm trying to alter the type of recordset returned from a SQL 7.0 Stored

> >

> > Procedure.

> >

> > How do I change the LockType, CursorType and Options?

> >

> > any help/suggestions/sample code would be greatly appreciated

> >

> > many thanks

> >

> > Pritesh

> >

>

>



---

FREE WEB DEVELOPMENT CODE, CONTENT, AND INSIGHTS

IN YOUR INBOX!

Get the latest and best HTML, XML, and JavaScript tips, tools, and 

developments from the experts.  Sign up for one or more of EarthWeb's

FREE IT newsletters at http://www.earthweb.com today!  

---

You are currently subscribed to asp_databases as: $subst('Recip.EmailAddr')

To unsubscribe send a blank email to leave-asp_databases-$subst('Recip.MemberIDChar')@p2p.wrox.com


  Return to Index