Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP 3 Classic ASP Active Server Pages 3.0 > Classic ASP Databases
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Databases section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old September 9th, 2008, 02:58 PM
Authorized User
 
Join Date: Mar 2006
Location: , , .
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Default Pass XML parameter to stored procedure

I'm trying to pass an XML parameter to a stored procedure. I had it working using the command object, but since the recordcount and pagecount refuse to work with the command object I had to switch to the connection object.

How can I pass an XML parameter to my stored procedure? Here is what I was using for the command object:

Code:
sXMLDoc = oXmlDom.selectSingleNode("/").xml
oCmd.Parameters.Append oCmd.CreateParameter("", adVarchar, adParamInput, Len(sXMLDoc), sXMLDoc)
The above worked for me, however there can be several thousands of rows returned, and the rest of the code only displays 250 records on the screen at a time so the recordcount and pagecount are needed.

Your help is appreciated.

Thanks

Reply With Quote
  #2 (permalink)  
Old September 9th, 2008, 06:12 PM
Friend of Wrox
 
Join Date: Jun 2008
Location: Snohomish, WA, USA
Posts: 1,649
Thanks: 3
Thanked 141 Times in 140 Posts
Default

So if that works for you, what's the point of your question???

If all you are trying to do is get the recordcount and pagecount, that has nothing at all to do with whether you used the value from XML or just used any old value.

It's all a matter of how you open the recordset. And you don't show that code.

*PROBABLY* what you need to do, after the code you show, is something like:

Code:
<%
...
Set RS = Server.CreateObject("ADODB.Recordset")
RS.PageSize = 10 ' or whatever size you want
RS.Open oCmd, ,3

recordCount = RS.recordCount
pageCount = RS.pageCount
...
%>
Reply With Quote
  #3 (permalink)  
Old September 10th, 2008, 08:38 AM
Authorized User
 
Join Date: Mar 2006
Location: , , .
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I found where my issue was. I didn't have single quotes around the xml parameter when using the recordset to open.

Thanks.
Reply With Quote
  #4 (permalink)  
Old September 10th, 2008, 02:07 PM
Friend of Wrox
 
Join Date: Jun 2008
Location: Snohomish, WA, USA
Posts: 1,649
Thanks: 3
Thanked 141 Times in 140 Posts
Default

How strange!??!!

YOu shouldn't need apostrophes around a value used with a command parameter, as in your code

oCmd.Parameters.Append oCmd.CreateParameter("", adVarchar, adParamInput, Len(sXMLDoc), sXMLDoc)

Are you saying you changed the way of opening the recordset??

Oh, well. Glad you got it working.
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
pass null to the parameter in the stored procedure kokila BOOK: Professional SQL Server Reporting Services ISBN: 0-7645-6878-7 0 July 12th, 2007 03:02 AM
how to pass value to stored procedure? hertendreef SQL Server 2005 3 February 23rd, 2007 11:43 AM
How to pass a parameter to a stored procedure? MaxGay2 VB.NET 2002/2003 Basics 1 November 8th, 2006 02:48 PM
Pass an Array as a Parameter to a Stored Procedure booksnore2 Oracle 0 August 31st, 2004 09:20 AM
How will I pass stored procedure in an asp shoakat SQL Server 2000 1 July 15th, 2004 10:28 PM



All times are GMT -4. The time now is 05:40 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.