Re: ADO call to user defined function
From: Val Mazur (group51a_at_hotmail.com)
Date: 05/21/04
- Next message: Val Mazur: "Re: What MDAC Verison"
- Previous message: Val Mazur: "Re: ADODB in C# problem"
- In reply to: MS news: "ADO call to user defined function"
- Next in thread: SBrickey: "Re: ADO call to user defined function"
- Reply: SBrickey: "Re: ADO call to user defined function"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 20 May 2004 22:19:07 -0400
Hi,
Since you cannot call UDF from the code directly, what you could do is to
wrap them into the stored procedure and call SP
--
Val Mazur
Microsoft MVP
"MS news" <Me@SBrickey.net> wrote in message
news:%23jCWxwdPEHA.4036@TK2MSFTNGP12.phx.gbl...
> 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
>
>
- Next message: Val Mazur: "Re: What MDAC Verison"
- Previous message: Val Mazur: "Re: ADODB in C# problem"
- In reply to: MS news: "ADO call to user defined function"
- Next in thread: SBrickey: "Re: ADO call to user defined function"
- Reply: SBrickey: "Re: ADO call to user defined function"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|