Re: Passing an adodb.command (which calls a stored procedure)to a func

Tech-Archive recommends: Speed Up your PC by fixing your registry



How is the code inside Build_SP_Command()? How is the command object and
any eventual parameters created inside this function?

Did you try with another command object created explicitely before the call
to Execute_SQL_GetRows_Command?

If CMD As ADODB.Command doesn't work, try to Dim it as an object.

--
Sylvain Lafontaine, ing.
MVP - Technologies Virtual-PC
E-mail: sylvain aei ca (fill the blanks, no spam please)


"RJ" <RJ@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:BE57C280-D024-4CD1-9A5F-D5AD0C697B13@xxxxxxxxxxxxxxxx
Dim CMD As ADODB.Command

Set CMD = Build_SP_Command("spfm_User_SalesLeadSearch_Dynamic")
Execute_SQL_GetRows_Command (CMD)
Set CMD = Nothing


Public Function Execute_SQL_GetRows_Command(CMD As ADODB.Command)
.....
End Function

When the above code executes it blows immediately on the
Execute_SQL_GetRows_Command giving a type mismatch error using the
adodb.command as a passed parameter. I know that the Set CMD = ... is
functioning properly; I use it throughout the project without any problem.
I
tried throwing a ByRef/Byval at the function but that didn't help. I have
several functions that return an adodb.command from a function , however
this
is the first time I am trying to pass an ADODB.Command to a function.

Any ideas on the correct syntax for passing an ADODB.Command to a
sub/function?

Thanks for your help!



.