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

Bill Benson bensonforums at gmail.com
Mon Jun 13 16:59:04 CDT 2022


Shot in the dark Ryan but thanks for the courtesy of looking.

On Mon, Jun 13, 2022 at 5:58 PM Ryan W <wrwehler at gmail.com> wrote:

> I did check that the ActiveX Data Objects 2.8 and 6.0 both have the
> constants in question via intellisense and using the immediate window I can
> refer to them there as well and they return a number.
>
> So I'm not sure if it's related to a reference problem.
>
> On Mon, Jun 13, 2022 at 3:32 PM Ryan W <wrwehler at gmail.com> wrote:
>
> > AFAIK I'm using 6.x but I'll have to check in the morning whether or not
> > the constants actually exist in my reference file.
> >
> > Either way I don't "need" the NVARCHAR or "LONG" types, I just need
> > something sane VARCHAR(50) is more than enough.. but adVarChar gives the
> > same message IIRC.
> >
> > I spent way too much time banging my head on it and then I found a stack
> > overflow post that suggested using adBSTR, which worked!
> >
> >
> >
> > On Mon, Jun 13, 2022 at 3:26 PM William Benson <vbacreations at gmail.com>
> > wrote:
> >
> >> Does it depend on which ado version referenced in your reference to ADO?
> >> Did you test those constants can be found in the object browser (F2 in
> >> VBA)
> >>
> >> On Mon, Jun 13, 2022 at 4:23 PM Ryan W <wrwehler at gmail.com> 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/datatypeenum?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
> >> >
> >> --
> >> *Regards,*
> >>
> >>
> >> *Bill Benson*
> >> *VBACreations*
> >>
> >> PS:  You've gotten this e-mail *because you matter to me!*
> >> --
> >> 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