ADO call to user defined function

From: MS news (Me_at_SBrickey.net)
Date: 05/19/04


Date: Wed, 19 May 2004 16:01:14 -0400

hello,

I recently decided that one of my stored procedures (which works fine) would
be better fit as a (scalar) user defined function. I used QA to move the
code, and tested, and it works fine. Unfortanately ASP feels differently, as
I get the error "Restricted data type attribute violation".

here is a snippet of the code...
 AdoCom.CommandText = "GetPricingBranchProductCost"
 AdoCom.CommandType = AdCmdStoredProc
 AdoCom.Parameters.Append AdoCom.CreateParameter("@ProdID", AdBigInt,
AdParamInput, , ProdID)
 AdoCom.Parameters.Append AdoCom.CreateParameter("@BrID", AdBigInt,
AdParamInput, , BrID)
 Set AdoRS = AdoCom.Execute

it blows up on the .Execute
I was concerned that the CommandType would be incorrect, and tried other
values (&H0001 and &H0008, for text and unknown, seemed to work best; but
complained about lacking parameters) but have had no success.

from what little i've found about calling UDF's from within ADO, commandtype
SHOULD work as stored proc (though this may be wrong)...
but when the SQL code WAS a stored proc, i never got these errors.

Any ideas appreciated.
Thanks,
-Scott



Relevant Pages

  • Re: ADO call to user defined function
    ... wrap them into the stored procedure and call SP ... > AdParamInput,, ProdID) ... > I was concerned that the CommandType would be incorrect, ... > but when the SQL code WAS a stored proc, ...
    (microsoft.public.data.ado)
  • Re: why cant i get a value back from this stored proc?
    ... > @iUserID INT, ... > the last statement run withing the stored proc should select the viewCount ... > adParamInput, 50, sViewSource) ...
    (microsoft.public.sqlserver)
  • Re: Mehrere SQL-Befehle in einer SP
    ... Set cmd = New ADODB.Command ... .CommandType = adCmdStoredProc ... .Parameters.Append .CreateParameter("Datvon", adDate, adParamInput, ...
    (microsoft.public.de.sqlserver)
  • Re: Error while calling an Oracle Stored Procedure from VB using ADO
    ... ,i_account_type IN VARCHAR2 ... Set cpw1 = New ADODB.Command ... .CommandType = adCmdText ... adNumeric, adParamInput,, 1) ...
    (comp.databases.oracle.server)
  • why cant i get a value back from this stored proc?
    ... @iUserID INT, ... select viewCount from recordAccess where userID = @iUserID and viewSource ... the last statement run withing the stored proc should select the viewCount ... .Parameters.Append .CreateParameter("@iUserID", adInteger, adParamInput, ...
    (microsoft.public.sqlserver)