Recordset from stored procedure with parameters

  • Thread starter Thread starter Stanley
  • Start date Start date
S

Stanley

I want to open an ADO recordset with rst.open ...
with a stored procedure. The problem is the stored
procedure has input parameters. Is there any way to pass a
parameter(s) to the stored procedure to get back my
recordset? I can do this with a command object with a
select statement in code in my front end.
Thanks,
Stan
 
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


I usually do this:

dim cn as new adodb.connection
dim rs as new adodb.recordset

cn.open currentproject.connection
set rs = cn.execute( "exec MyProc 1, '8/25/2004'",,adCmdText )

1 and '8/25/2004' are the parameters. You can put the parameters in a
string and just concatenate that string into the "exec ..." string.

--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBQTUJBYechKqOuFEgEQIoiwCgnapTUCJAwdDxccAiiycoKsWf5GkAoON1
C9M1XAUSi2SXl5xuES7a7nE8
=aFQX
-----END PGP SIGNATURE-----
 
Back
Top