"Failed to open a rowset", "Cannot obtain error message from Server."

Hi...I've been working on this report for the past few days and I
haven't been able to solve this problem! I'm using Crystal 9.0 and I've

got 2 subreports within a main report and they connect to a stored
procedure via ODBC...every time I enter a parameter that has no
matching records, I get the following two messages "Failed to open a
rowset" and "Not supported. Details: Cannot obtain error message from
Server." I can't figure out where or why this occurs...Can anyone look
this over and see what I'm doing wrong??

1st Subreport


declare @curruser decimal


set @curruser =3D -32746


BEGIN


BEGIN TRANSACTION


SELECT invlnkey, apprkey, CONVERT(int,rank*100+sequence) AS rankseq
  INTO #npoallwaiting
  FROM  npoapp
  WHERE npoapp.approved=3D0
  AND npoapp.apprkey IN
   (SELECT userkey FROM userlist
     WHERE (userkey=3D@curruser AND canepp=3D1) OR
     (altinvapprov=3D@curruser AND vacation=3D1 AND canepp=3D1))


COMMIT TRANSACTION


BEGIN TRANSACTION


SELECT invlnkey,MIN(rankseq) AS minrank
  INTO #npominwaiting
  FROM #npoallwaiting
  GROUP BY invlnkey


COMMIT TRANSACTION


BEGIN TRANSACTION


SELECT
#npoallwaiting.invlnkey,#npoallwaiting.apprkey,#npoallwaiting.rankseq
  INTO #npowaiting
  FROM #npoallwaiting,#npominwaiting
  WHERE #npoallwaiting.invlnkey=3D#npominwaiting.invlnkey
  AND   #npoallwaiting.rankseq=3D#npominwaiting.minrank


COMMIT TRANSACTION


BEGIN TRANSACTION


SELECT DISTINCT invkey
  INTO #npowaitreqs
  FROM npoln,#npowaiting
  WHERE npoln.invlnkey=3D#npowaiting.invlnkey
  AND #npowaiting.invlnkey NOT IN
 (SELECT npoapp.invlnkey
  FROM npoapp,#npowaiting
  WHERE npoapp.invlnkey =3D #npowaiting.invlnkey
  AND npoapp.approved=3D0
  AND CONVERT(int,rank*100+sequence) < #npowaiting.rankseq)


COMMIT TRANSACTION


BEGIN TRANSACTION


SELECT DISTINCT invnumber,npohdr.invkey,invdate,orderdate,
  vname,origdate,npohdr.tstamp,npohdr.vendno,
  (SELECT SUM(npoln.price * npoln.quantity * npoln.pricefact) FROM
npoln WHERE npoln.invkey=3D#npowaitreqs.invkey) AS
computedinvtotal,actinvtotal,
  npohdr.itypekey,itypehdr.descr AS
itypedescr,npohdr.reqrcode,reqr.name AS
reqrname,npohdr.approvedate,hdrdescr,npohdr.status,npohdr.origkey,npohdr.or=
=ADigtype

 FROM npohdr INNER JOIN #npowaitreqs ON
npohdr.invkey=3D#npowaitreqs.invkey
 INNER JOIN npoln ON npoln.invkey=3D#npowaitreqs.invkey
 INNER JOIN itypehdr ON itypehdr.itypekey=3Dnpohdr.itypekey
 INNER JOIN vend ON npohdr.vendno=3Dvend.vendno
 LEFT JOIN reqr ON reqr.userkey=3Dnpohdr.reqrcode
WHERE npohdr.status=3D'G'


end


2nd Subreport


USE [PNetSQL]
GO
/****** Object:  StoredProcedure [dbo].[reqwait]    Script Date:
11/16/2006 11:28:53 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO


/*
 * PROCEDURE: reqwait
 */


 CREATE PROCEDURE [dbo].[reqwait]
  (@curruser smallint) AS
BEGIN


BEGIN TRANSACTION


SELECT reqlnkey, userkey, CONVERT(smallint,rank*100+sequence) AS
rankseq
  INTO #allwaiting
  FROM  reqapp
  WHERE reqapp.approved=3D0
  AND  reqapp.userkey IN
   (SELECT userkey FROM userlist
     WHERE (userkey=3D@curruser AND approvreq=3D1) OR
     (altapprov=3D@curruser AND vacation=3D1 AND approvreq=3D1))


COMMIT TRANSACTION


BEGIN TRANSACTION


SELECT reqlnkey,MIN(rankseq) AS minrank
  INTO #minwaiting
  FROM #allwaiting
  GROUP BY reqlnkey


COMMIT TRANSACTION


BEGIN TRANSACTION


SELECT #allwaiting.reqlnkey,#allwaiting.userkey,#allwaiting.rankseq
  INTO #waiting
  FROM #allwaiting,#minwaiting
  WHERE #allwaiting.reqlnkey=3D#minwaiting.reqlnkey
  AND   #allwaiting.rankseq=3D#minwaiting.minrank


COMMIT TRANSACTION


BEGIN TRANSACTION


SELECT DISTINCT reqkey
  INTO #waitreqs
  FROM reqln,#waiting
  WHERE reqln.reqlnkey=3D#waiting.reqlnkey
  AND #waiting.reqlnkey NOT IN
 (SELECT reqapp.reqlnkey
  FROM reqapp,#waiting
  WHERE reqapp.reqlnkey =3D #waiting.reqlnkey
  AND reqapp.approved=3D0
  AND CONVERT(smallint,rank*100+sequence) < #waiting.rankseq)


COMMIT TRANSACTION


BEGIN TRANSACTION


SELECT DISTINCT reqkeys.reqkey, convert(char(12), reqkeys.assigned,
107) as created,
                reqkeys.reqnumber, reqkeys.assigned,
                reqln.reqrcode, reqr.name as reqrname,
  (SELECT SUM(reqln.price * reqln.quantity * reqln.pricefact)
        FROM reqln WHERE reqln.reqkey =3D #waitreqs.reqkey) AS reqtotal,
                reqhdr.ordertype, syscode.description as reqtype,
reqhdr.descr as
reqname
                from reqkeys, reqln, reqr, reqhdr, syscode, #waitreqs
                where reqkeys.reqkey =3D #waitreqs.reqkey
                AND reqln.reqkey =3D #waitreqs.reqkey
                AND reqhdr.reqkey =3D #waitreqs.reqkey
                AND reqr.userkey =3D reqln.reqrcode
                AND syscode.code =3D reqhdr.ordertype
                AND UPPER(syscode.tablename) =3D 'REQHDR'
                AND UPPER(syscode.fieldname) =3D 'ORDERTYPE'


COMMIT TRANSACTION=20


END

0
zabedi (2)
11/29/2006 2:23:55 PM
crm 35858 articles. 1 followers. Follow

0 Replies
632 Views

Similar Articles

[PageSpeed] 13

Reply:

Similar Artilces:

"Failed to open a rowset", "Cannot obtain error message from Server."
Hi...I've been working on this report for the past few days and I haven't been able to solve this problem! I'm using Crystal 9.0 and I've got 2 subreports within a main report and they connect to a stored procedure via ODBC...every time I enter a parameter that has no matching records, I get the following two messages "Failed to open a rowset" and "Not supported. Details: Cannot obtain error message from Server." I can't figure out where or why this occurs...Can anyone look this over and see what I'm doing wrong?? 1st Subreport declare @curruser ...