473,320 Members | 1,612 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Output parameter read from stored procedure empty

vavc1980
I'm using a stored procedure from an ASP page using a ADODB connection, the sproc returns a value and also has an output parameter.
Both are being read in the page but they are both empty, I profiled the sproc call and tested it directly and the values are being returned correctly.

What could the problem be? quick note: in another server the same code works fine.

The code I'm using to get the values looks like (just the relevant part where parameters are set then when reading the values).

Expand|Select|Wrap|Line Numbers
  1. '... objects are declared, etc. command name is adoCommand
  2. '... objects are initialized (connetions strings, etc), and command type is adCmdStoredProc
  3. '... sproc parameters are created.
  4. adoParams.Append adoCommand.CreateParameter("@RETURN_VALUE", adInteger, adParamReturnValue, 4)
  5. adoParams.Append adoCommand.CreateParameter("@id", adInteger, adParamOutput, 4)
  6. adoParams.Append adoCommand.CreateParameter("@name", adVarchar, adParamInput, 100, Left(Name, 100))
  7.  
  8. adoCommand.Execute
  9.  
  10. '... next statement is alway true even when the return value (when tested directly in SQL) is 1
  11. If adoParams.Item("@RETURN_VALUE").Value <> 1 Then
  12.   ' some code here
  13. End If
  14.  
  15. '... next statement always return nothing even when the output parameter has a value (again, tested directly in sql)
  16. clientId = adoParams.Item("@id").Value
  17.  
  18.  
Apr 6 '11 #1
0 1544

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Begoña | last post by:
in my java application I've made a call to this stored procedure CREATE procedure pruebaICM @pANI varchar(20), @pTABLA varchar(20), @pInsert varchar(500), @pUpdate varchar(1000), @pFLAG...
1
by: Agnes | last post by:
I try to set an output parameter to get the result from store procedure, However,Do I still need to loop the reader to get result ?? Thanks a lot cmdKey.Parameters("@result").Direction =...
1
by: Dave McKie | last post by:
Hi all, Need some help again. I am trying to retrieve an output from a Stored Procedure...not having much luck. If anyone could steer me in the right direction, it would be appreciated. I'm...
0
by: Ben | last post by:
Hi I have the code below which i got from: It only appers to return 1 from the stored procedure, where as the figure should be 43253 Any help with a solution would be much appreciated, ...
4
by: jleeie | last post by:
Can someone help me, I'm going round in circles with this and my head is cabbaged ! I am using visual studio 2005 & VB & MS SQL 2005 I am trying to execute a stored procedure from within a...
5
by: Question123 | last post by:
Hello .. I want Output of SP1 stored procedure in #Temp TABLE OF SP2. Something like this ....... CREATE SP2 @iLoginId INT AS BEGIN
7
by: jamesclose | last post by:
My problem is this (apologies if this is a little long ... hang in there): I can define a function in VB.NET with optional parameters that wraps a SQL procedure: Sub Test(Optional ByVal Arg1...
0
by: mstres | last post by:
I call SP from Access 2003 using qrydef (I am using DAO and my Access Tables link to MySQL DB with ODBC connection. I create SP in MySQL with Transaction and Error Handler. It is working find with...
3
by: shanboy | last post by:
Stored procedure ALTER proc .(@searchBy nvarchar(50),@searchKey nvarchar(50)) as select * from CD_DETAILS where @searchBy like '%' +@searchKey+ '%' I'm using ASP.net2.0 with c# to extract...
0
by: tokcy | last post by:
Hi all, After a long time i am back with a new problem. Right now I am having a problem with stored procedure. I am using stored procedure with PHP/MYSQL. And evry time I am changing the...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.