Wrox Programmer Forums
|
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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 16th, 2004, 03:05 AM
Friend of Wrox
 
Join Date: Sep 2004
Posts: 104
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to sureshbabu Send a message via Yahoo to sureshbabu
Default

Hi Vijay,
     If i use objCommand.item(0) I am getting the first parameter name(@empno") and If I use objCommand.item(0).value I am getting the value of the parameter which i am sending.
     If I write objCommand.item(1) I am getting name of the return parametre as "@x" and if i use
objCommand.item(0).value I am not getting any value.

If i execute the same sp in query analizer i am getting correct result..
I need Your help in this regard
Thnaks
Suresh
If possible mail to the id ([email protected])


 
Old September 16th, 2004, 03:09 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

Hope you haven't gone through the article I referred in my previous post.

At this point the stored procedure has been executed and cmd.parameters(0) contains the return value.

Did you try this? What do you get if you use objCommand.parameters(0)

Cheers!

_________________________
- Vijay G
Strive for Perfection
 
Old September 16th, 2004, 04:38 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,212
Thanks: 0
Thanked 1 Time in 1 Post
Default

There are two problems with your approach:
1. if you want to get the return value then it must be the first parameter added to the collection, so you're adding the params in the wrong order.
2. return values can only be INT, they cannot be VARCHAR. So you can't use this method to capture the employee name - you'll have to use an explicit output parameter to get a varchar back.

hth
Phil
 
Old September 17th, 2004, 12:21 AM
Friend of Wrox
 
Join Date: Sep 2004
Posts: 104
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to sureshbabu Send a message via Yahoo to sureshbabu
Default

Hi brain,
     I changed the order of creation of parameters. Now i am getting result i want exactly.. As Vijay said i tried with (parameters(0)). But it is not giving result. And one ore thing, here i am getting varchar as return type. ther is no such condition that function only return integers. It can return data of any type.
I just kept return parameter at the first in theparameters list.
Now i am out of trouble.
Thanks for you all to make me get out of this probelm..
Once again thanks..

 
Old September 17th, 2004, 12:32 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

Does changing the index help? Though it is not defined to be the first param.
objCommand.parameters(1)

_________________________
- Vijay G
Strive for Perfection
 
Old September 17th, 2004, 03:14 AM
Friend of Wrox
 
Join Date: Sep 2004
Posts: 104
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to sureshbabu Send a message via Yahoo to sureshbabu
Default

Hi Vijay,
I tried like that also.
I declared return parameter as second one and
I used objCommand.parameters(1) to get that .
But i didnt get any result.
By this my conclusion is return parameter should be daclared as the first one.

Thanks
Suresh babu





Similar Threads
Thread Thread Starter Forum Replies Last Post
Codeplot expects NCName why? djones425 BOOK: Beginning XML, 4th Ed ISBN: 978-0-470-11487-2 0 March 3rd, 2008 01:11 AM
Parameter object malfunction - out parameter dash dev C# 2005 6 December 4th, 2007 12:58 PM
parameter umeshtheone Beginning VB 6 0 May 23rd, 2007 01:13 AM
ERROR: Procedure or Function 'x' expects paramater rsearing ASP.NET 2.0 Basics 7 March 3rd, 2007 07:02 AM
another parameter drachx Crystal Reports 0 October 3rd, 2005 07:52 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.