Solved

Access (ADP) Report problem using a stored procedure

Posted on 2004-09-23
3
240 Views
Last Modified: 2011-09-20
Hello everyone,

I've got a problem.  I am trying to run a report off of a Stored Procedure in SQL Server (using an ADP project database).  I bound the report to the Stored Procedure.  However, I get an error message when I run it.  I think it has something to do with my temporary table.  Do I need to issue an OUTPUT parameter?  Please help.  I have listed the code below.

---------------------------------------------------------------------------------------------------
CREATE PROCEDURE dbo.usp_Referrals_PotentialDuplicate1
AS

Create Table #TempTable (Account varchar(30), lastname varchar(30), dischargeDate DateTime, PTName varchar(30), RCVD smalldatetime, DIS smalldatetime, MGR char(10), Hospitalname Char(50), Hospitalcode Int)

Insert INTO #TempTable
Select referrals_dts.Account, lastname, dischargeDate, patient_Table.[name], rcvd, dis, patient_table.mgr, referrals_DTS.hospital, hospitalcode
From Referrals_DTS INNER Join Patient_Table ON referrals_DTS.account = patient_table.account
where referrals_DTS.hospitalcode = Patient_Table.hospital

Insert INTO #temptable
Select type_indicator + referrals_dts.account as ptaccount, lastname, dischargeDate, patient_Table.[name], rcvd, dis, patient_table.mgr, referrals_dts.hospital, hospitalcode
from (referrals_DTS Inner Join Patient_Table ON referrals_DTS.account = patient_table.account) Left Join Patient_type ON referrals_dts.patienttype = patient_type.patient_type
Where type_indicator + referrals_dts.account = patient_table.account and referrals_DTS.hospitalcode = Patient_Table.hospital

Select * from #temptable

GO
----------------------------------------------------------------------
I get the error message: "Provider Command for Child Rowset Does not Produre a Rowset".

Please help.
Frank
0
Comment
Question by:franksale
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 14

Accepted Solution

by:
ragoran earned 500 total points
ID: 12135865
You don't have any parameters or logic.  Have you tried to create a vie instead and bound your report to it:

CREATE VIEW dbo.uvw__Referrals_PotentialDuplicate1
as

Select referrals_dts.Account, lastname, dischargeDate, patient_Table.[name], rcvd, dis, patient_table.mgr, referrals_DTS.hospital, hospitalcode
From Referrals_DTS INNER Join Patient_Table ON referrals_DTS.account = patient_table.account
where referrals_DTS.hospitalcode = Patient_Table.hospital

UNION ALL

Select type_indicator + referrals_dts.account as ptaccount, lastname, dischargeDate, patient_Table.[name], rcvd, dis, patient_table.mgr, referrals_dts.hospital, hospitalcode
from (referrals_DTS Inner Join Patient_Table ON referrals_DTS.account = patient_table.account) Left Join Patient_type ON referrals_dts.patienttype = patient_type.patient_type
Where type_indicator + referrals_dts.account = patient_table.account and referrals_DTS.hospitalcode = Patient_Table.hospital

0
 
LVL 1

Author Comment

by:franksale
ID: 12136051
Humm... That's is a good idea.  It looks like it will work.  Thanks for your help.  

I would still like to know how to send the information out of a stored procedure though.  It seems to work in Query Analyzer.  Other procedures seem to work when I am not using temporary tables.  Any ideas how to get it to work?

Frank
0
 
LVL 14

Expert Comment

by:ragoran
ID: 12136106
My guess is...

Temporary tables exist only dring the scope (e.g. execution time) of the store procedure.  so when the store procedure ends, its temporary object are destroyed (there are temporary after all)...
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.

696 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question