Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old July 19th, 2005, 11:39 AM
Bruce Duncan
Guest
 
Posts: n/a
Default Empty Recordset???

I'm calling a SQL stored procedure with the folowing
code. It seems to work fine but I want to know if it
doesn't return any rows and the oRsCatList.eof is not
working.

lcDisplayCatList = "Y"
Set oConn = Server.CreateObject("ADODB.Connection")
oConn.Open Session("strConn")
Set oCmd = Server.CreateObject("ADODB.Command")
set oCmd.ActiveConnection = oConn
oCmd.CommandText = "spCategoryList"
oCmd.commandtype = AdCmdStoredProc
oCmd.Parameters.Append oCmd.CreateParameter("@CatID",
adInteger, adParamInput)
oCmd.Parameters("@CatID") = lnCatID
set oRsCatList = oCmd.Execute
if oRsCatList.EOF then
lcDisplayCatList = "N"
end if

Even when it doesn't return any rows, lcDisplayCatList is
still = "Y"
Can anyone help point me in the right direction?

TIA
-Bruce
  #2  
Old July 19th, 2005, 11:39 AM
Chris Hohmann
Guest
 
Posts: n/a
Default Re: Empty Recordset???


"Bruce Duncan" <anonymous@discussions.microsoft.com> wrote in message
news:8f4901c3ea7b$c9612610$a301280a@phx.gbl...[color=blue]
> I'm calling a SQL stored procedure with the folowing
> code. It seems to work fine but I want to know if it
> doesn't return any rows and the oRsCatList.eof is not
> working.
>
> lcDisplayCatList = "Y"
> Set oConn = Server.CreateObject("ADODB.Connection")
> oConn.Open Session("strConn")
> Set oCmd = Server.CreateObject("ADODB.Command")
> set oCmd.ActiveConnection = oConn
> oCmd.CommandText = "spCategoryList"
> oCmd.commandtype = AdCmdStoredProc
> oCmd.Parameters.Append oCmd.CreateParameter("@CatID",
> adInteger, adParamInput)
> oCmd.Parameters("@CatID") = lnCatID
> set oRsCatList = oCmd.Execute
> if oRsCatList.EOF then
> lcDisplayCatList = "N"
> end if
>
> Even when it doesn't return any rows, lcDisplayCatList is
> still = "Y"
> Can anyone help point me in the right direction?
>
> TIA
> -Bruce[/color]

SET NOCOUNT ON
http://www.aspfaq.com/show.asp?id=2246


  #3  
Old July 19th, 2005, 11:39 AM
Bruce Duncan
Guest
 
Posts: n/a
Default Re: Empty Recordset???

Here's my SQL Proc: Is this what you meant?

CREATE PROCEDURE spCategoryList @CatID integer AS

set nocount on

select qcncategory.categoryid, qcncategory.categoryname,
qcnproduct.productid, qcnproduct.productname,
qcnproduct.prodpicture,
qcnproditem.qcnprice, qcnproditem.supply
from qcncategory
left join qcnproduct
inner join qcnproditem on
qcnproduct.productid = qcnproditem.productid
on qcncategory.categoryid = qcnproduct.categoryid
where qcncategory.categoryid = @CatID
GO

-Bruce

[color=blue]
>-----Original Message-----
>
>"Bruce Duncan" <anonymous@discussions.microsoft.com>[/color]
wrote in message[color=blue]
>news:8f4901c3ea7b$c9612610$a301280a@phx.gbl...[color=green]
>> I'm calling a SQL stored procedure with the folowing
>> code. It seems to work fine but I want to know if it
>> doesn't return any rows and the oRsCatList.eof is not
>> working.
>>
>> lcDisplayCatList = "Y"
>> Set oConn = Server.CreateObject("ADODB.Connection")
>> oConn.Open Session("strConn")
>> Set oCmd = Server.CreateObject("ADODB.Command")
>> set oCmd.ActiveConnection = oConn
>> oCmd.CommandText = "spCategoryList"
>> oCmd.commandtype = AdCmdStoredProc
>> oCmd.Parameters.Append oCmd.CreateParameter("@CatID",
>> adInteger, adParamInput)
>> oCmd.Parameters("@CatID") = lnCatID
>> set oRsCatList = oCmd.Execute
>> if oRsCatList.EOF then
>> lcDisplayCatList = "N"
>> end if
>>
>> Even when it doesn't return any rows, lcDisplayCatList[/color][/color]
is[color=blue][color=green]
>> still = "Y"
>> Can anyone help point me in the right direction?
>>
>> TIA
>> -Bruce[/color]
>
>SET NOCOUNT ON
>http://www.aspfaq.com/show.asp?id=2246
>
>
>.
>[/color]
  #4  
Old July 19th, 2005, 11:39 AM
Guest
 
Posts: n/a
Default Re: Empty Recordset???

This is the actual code...and it doesn't help.

CREATE PROCEDURE spCategoryList @CatID integer AS

begin
set nocount on

select qcncategory.categoryid, qcncategory.categoryname,
qcnproduct.productid, qcnproduct.productname,
qcnproduct.prodpicture,
qcnproditem.qcnprice, qcnproditem.supply
from qcncategory
left join qcnproduct
inner join qcnproditem on
qcnproduct.productid = qcnproditem.productid
on qcncategory.categoryid = qcnproduct.categoryid
where qcncategory.categoryid = @CatID

end
GO

-Bruce
[color=blue]
>-----Original Message-----
>Here's my SQL Proc: Is this what you meant?
>
>CREATE PROCEDURE spCategoryList @CatID integer AS
>
>set nocount on
>
>select qcncategory.categoryid, qcncategory.categoryname,
>qcnproduct.productid, qcnproduct.productname,
>qcnproduct.prodpicture,
>qcnproditem.qcnprice, qcnproditem.supply
>from qcncategory
> left join qcnproduct
> inner join qcnproditem on
>qcnproduct.productid = qcnproditem.productid
> on qcncategory.categoryid = qcnproduct.categoryid
>where qcncategory.categoryid = @CatID
>GO
>
>-Bruce
>
>[color=green]
>>-----Original Message-----
>>
>>"Bruce Duncan" <anonymous@discussions.microsoft.com>[/color]
>wrote in message[color=green]
>>news:8f4901c3ea7b$c9612610$a301280a@phx.gbl...[color=darkred]
>>> I'm calling a SQL stored procedure with the folowing
>>> code. It seems to work fine but I want to know if it
>>> doesn't return any rows and the oRsCatList.eof is not
>>> working.
>>>
>>> lcDisplayCatList = "Y"
>>> Set oConn = Server.CreateObject("ADODB.Connection")
>>> oConn.Open Session("strConn")
>>> Set oCmd = Server.CreateObject("ADODB.Command")
>>> set oCmd.ActiveConnection = oConn
>>> oCmd.CommandText = "spCategoryList"
>>> oCmd.commandtype = AdCmdStoredProc
>>> oCmd.Parameters.Append oCmd.CreateParameter("@CatID",
>>> adInteger, adParamInput)
>>> oCmd.Parameters("@CatID") = lnCatID
>>> set oRsCatList = oCmd.Execute
>>> if oRsCatList.EOF then
>>> lcDisplayCatList = "N"
>>> end if
>>>
>>> Even when it doesn't return any rows,[/color][/color][/color]
lcDisplayCatList[color=blue]
>is[color=green][color=darkred]
>>> still = "Y"
>>> Can anyone help point me in the right direction?
>>>
>>> TIA
>>> -Bruce[/color]
>>
>>SET NOCOUNT ON
>>http://www.aspfaq.com/show.asp?id=2246
>>
>>
>>.
>>[/color]
>.
>[/color]
  #5  
Old July 19th, 2005, 11:39 AM
Bruce Duncan
Guest
 
Posts: n/a
Default Empty Recordset???

FOUND THE PROBLEM...
it was me...of course I get at least one row to
return...that's why it's not empty...it's not supposed to
be empty...instead of checkinf EOF, I need to check if
emtpy(fieldname)...

Thanks for your post Chris...

-Bruce
[color=blue]
>-----Original Message-----
>I'm calling a SQL stored procedure with the folowing
>code. It seems to work fine but I want to know if it
>doesn't return any rows and the oRsCatList.eof is not
>working.
>
>lcDisplayCatList = "Y"
>Set oConn = Server.CreateObject("ADODB.Connection")
>oConn.Open Session("strConn")
>Set oCmd = Server.CreateObject("ADODB.Command")
>set oCmd.ActiveConnection = oConn
>oCmd.CommandText = "spCategoryList"
>oCmd.commandtype = AdCmdStoredProc
>oCmd.Parameters.Append oCmd.CreateParameter("@CatID",
>adInteger, adParamInput)
>oCmd.Parameters("@CatID") = lnCatID
>set oRsCatList = oCmd.Execute
>if oRsCatList.EOF then
> lcDisplayCatList = "N"
>end if
>
>Even when it doesn't return any rows, lcDisplayCatList[/color]
is[color=blue]
>still = "Y"
>Can anyone help point me in the right direction?
>
>TIA
>-Bruce
>.
>[/color]
  #6  
Old July 19th, 2005, 11:39 AM
TomB
Guest
 
Posts: n/a
Default Re: Empty Recordset???

Have you tried executing the stored procedure in Query Analyzer?



<anonymous@discussions.microsoft.com> wrote in message
news:9a6501c3ea82$b44366b0$a601280a@phx.gbl...[color=blue]
> This is the actual code...and it doesn't help.
>
> CREATE PROCEDURE spCategoryList @CatID integer AS
>
> begin
> set nocount on
>
> select qcncategory.categoryid, qcncategory.categoryname,
> qcnproduct.productid, qcnproduct.productname,
> qcnproduct.prodpicture,
> qcnproditem.qcnprice, qcnproditem.supply
> from qcncategory
> left join qcnproduct
> inner join qcnproditem on
> qcnproduct.productid = qcnproditem.productid
> on qcncategory.categoryid = qcnproduct.categoryid
> where qcncategory.categoryid = @CatID
>
> end
> GO
>
> -Bruce
>[color=green]
> >-----Original Message-----
> >Here's my SQL Proc: Is this what you meant?
> >
> >CREATE PROCEDURE spCategoryList @CatID integer AS
> >
> >set nocount on
> >
> >select qcncategory.categoryid, qcncategory.categoryname,
> >qcnproduct.productid, qcnproduct.productname,
> >qcnproduct.prodpicture,
> >qcnproditem.qcnprice, qcnproditem.supply
> >from qcncategory
> > left join qcnproduct
> > inner join qcnproditem on
> >qcnproduct.productid = qcnproditem.productid
> > on qcncategory.categoryid = qcnproduct.categoryid
> >where qcncategory.categoryid = @CatID
> >GO
> >
> >-Bruce
> >
> >[color=darkred]
> >>-----Original Message-----
> >>
> >>"Bruce Duncan" <anonymous@discussions.microsoft.com>[/color]
> >wrote in message[color=darkred]
> >>news:8f4901c3ea7b$c9612610$a301280a@phx.gbl...
> >>> I'm calling a SQL stored procedure with the folowing
> >>> code. It seems to work fine but I want to know if it
> >>> doesn't return any rows and the oRsCatList.eof is not
> >>> working.
> >>>
> >>> lcDisplayCatList = "Y"
> >>> Set oConn = Server.CreateObject("ADODB.Connection")
> >>> oConn.Open Session("strConn")
> >>> Set oCmd = Server.CreateObject("ADODB.Command")
> >>> set oCmd.ActiveConnection = oConn
> >>> oCmd.CommandText = "spCategoryList"
> >>> oCmd.commandtype = AdCmdStoredProc
> >>> oCmd.Parameters.Append oCmd.CreateParameter("@CatID",
> >>> adInteger, adParamInput)
> >>> oCmd.Parameters("@CatID") = lnCatID
> >>> set oRsCatList = oCmd.Execute
> >>> if oRsCatList.EOF then
> >>> lcDisplayCatList = "N"
> >>> end if
> >>>
> >>> Even when it doesn't return any rows,[/color][/color]
> lcDisplayCatList[color=green]
> >is[color=darkred]
> >>> still = "Y"
> >>> Can anyone help point me in the right direction?
> >>>
> >>> TIA
> >>> -Bruce
> >>
> >>SET NOCOUNT ON
> >>http://www.aspfaq.com/show.asp?id=2246
> >>
> >>
> >>.
> >>[/color]
> >.
> >[/color][/color]


 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles