Re: ADO call to user defined function
From: Val Mazur (group51a_at_hotmail.com)
Date: 05/22/04
- Next message: Kevin Yu [MSFT]: "Re: ADO Asynchronous Problems on dual-cpu / hyperthreading computers"
- Previous message: Val Mazur: "Re: Timeout with Where statement"
- In reply to: SBrickey: "Re: ADO call to user defined function"
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 21 May 2004 22:27:26 -0400
Hi,
This is actually not and ADO's issue. ADO works through OLEDB provider and
support all the features, which supported by OLEDB. OLEDB provider for SQL
Server was developed some time ago, when SQL Server did not have UDF's. This
is why ADO does not support them as well. Same issue when you try to call
any UDF, written in VB Script in a Access database.
--
Val Mazur
Microsoft MVP
"SBrickey" <Me@SBrickey.net> wrote in message
news:OdYGK4yPEHA.308@TK2MSFTNGP11.phx.gbl...
> Hi,
>
> Can you think of an effective method of creating a single SP which can be
> passed parameters, to dynamically call ANY UDF, also containing the
> parameters?
>
> I suppose i could have an SP with perhaps a dozen params, figuring every
> UDF
> has < 12 params (figuring 1 param to specify which UDF i'm wanting to
> use).... doesn't seem like a great solution though.
>
> I'm kinda suprised that there's no direct method for ADO to call UDF's,
> yet
> so much support for SP's... oh well
>
> Ideas?
>
> -Scott
>
> "Val Mazur" <group51a@hotmail.com> wrote in message
> news:uEAr#ntPEHA.3016@tk2msftngp13.phx.gbl...
>> 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: Kevin Yu [MSFT]: "Re: ADO Asynchronous Problems on dual-cpu / hyperthreading computers"
- Previous message: Val Mazur: "Re: Timeout with Where statement"
- In reply to: SBrickey: "Re: ADO call to user defined function"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|
Loading