[AccessD] Retrieving output param from stored procedure (ADO CMD Param)

Ryan W wrwehler at gmail.com
Tue Jun 14 08:58:08 CDT 2022


 Well as it turns out .Parameters.Refresh can help avoid output
datatype/length confusion since it fetches those values from the
procedure.  I know it's a network round trip but sure makes it a lot easier.



On Mon, Jun 13, 2022 at 9:40 PM Stuart McLachlan <stuart at lexacorp.com.pg>
wrote:

> Your ADO return variant needs to be the same type  as your SP is returning.
> BSTR = null terminated wide string.  That must be what your SP is
> returning.
> That's why other data types are retunring "item not found..."
> Just assign it a string and it should work fine.
>
> If your SP returns a numeric value, then adINT or whaterver should work
> fine.
>
> On 13 Jun 2022 at 15:22, Ryan W wrote:
>
> > Can anyone point out what I'm doing wrong?
> >
> > Trying to retrieve a VARCHAR type output parameter from a stored proc:
> >
> > The only DataTypeEnum that has worked for me is adBSTR
> >
> > https://docs.microsoft.com/en-us/sql/ado/reference/ado-api/datatypeenu
> > m?view=sql-server-ver16
> >
> >
> > If I use adVarChar, adVarWChar, adLongVarChar, adLongVarWChar I get an
> > "Item not found in collection" message. (error 3265).
> >
> > If I use adBSTR it works but I haven't tested on what it'll do if I
> > return a simple INT data type but it DOES work with VARCHAR(MAX). --
> > AccessD mailing list AccessD at databaseadvisors.com
> > https://databaseadvisors.com/mailman/listinfo/accessd Website:
> > http://www.databaseadvisors.com
> >
>
>
> --
> AccessD mailing list
> AccessD at databaseadvisors.com
> https://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
>


More information about the AccessD mailing list