Recordset from stored procedure with parameters

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
 
M

MGFoster

-----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-----
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top