Building a stored procedure into a report's record source

C

Candace

I know I have to use a stored procedure when I'm using
form parameters but I was wondering am I able to build the
stored procedure within the report rather than save that
stored procedure as a separate object then reference that
stored procedure name as the record source?

I don't like having a lot of unnecceary separate objects
and rather build it in. OR Should they be stored
procedures that are saved because the SQL server handles
the records differently and it is more optimal/efficient
to do it that way.

I tried just cutting and pasting the stored procedure in
like this
Alter PROCEDURE Patient_Line_Listing @Start_Date
datetime, @E ...
But as you can see I reference the procedure name
Patient_Line_Listing. I am assuming I have to set it up
as a temporary procedure but I don't know what the syntax
is.

Any thoughts?

Candace
 
M

MGFoster

Candace said:
I know I have to use a stored procedure when I'm using
form parameters but I was wondering am I able to build the
stored procedure within the report rather than save that
stored procedure as a separate object then reference that
stored procedure name as the record source?
< SNIP >

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

The stored procedure (SP) is located (stored) on the server not in the
Access .adp file.

No, you cannot build the SP in the report's RecordSource.

Use the report's Input Parameters property to pass parameters to the
SP.

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

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

iQA/AwUBQFJ7gIechKqOuFEgEQLZ/QCg2ooa8hH9/o0cPzUuaKEgkRrfcuYAoLhL
A2Mt+5i+iOb1NkXKPa49XhQ2
=3+NW
-----END PGP SIGNATURE-----
 
C

Candace

I realize that the stored procedure is on the server and
not in the adp file. If I can have a view written within
the record source for a combo box in a form, why can't I
have a stored procedure written within the record source
for a report? How are the two different?

I understand the concept of the input parameters with a
stored procedure and have that working fine. I'm just
trying to make the transistion from Access database to
Access project / SQL server. I've always had the habit of
building the record source within the form / report
whenever I could, now I'm trying to find the Access
project / SQL server equivalent. I find the design bulky
when I have a separate stored procedure for every report
and subreport.

Candace
 

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