473,396 Members | 1,784 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

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
Jul 19 '05 #1
5 2648

"Bruce Duncan" <an*******@discussions.microsoft.com> wrote in message
news:8f****************************@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, lcDisplayCatList is
still = "Y"
Can anyone help point me in the right direction?

TIA
-Bruce


SET NOCOUNT ON
http://www.aspfaq.com/show.asp?id=2246
Jul 19 '05 #2
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

-----Original Message-----

"Bruce Duncan" <an*******@discussions.microsoft.com> wrote in messagenews:8f****************************@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, lcDisplayCatList is still = "Y"
Can anyone help point me in the right direction?

TIA
-Bruce


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

Jul 19 '05 #3
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
-----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

-----Original Message-----

"Bruce Duncan" <an*******@discussions.microsoft.com>wrote in message
news:8f****************************@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,
lcDisplayCatListis still = "Y"
Can anyone help point me in the right direction?

TIA
-Bruce


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

.

Jul 19 '05 #4
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
-----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 isstill = "Y"
Can anyone help point me in the right direction?

TIA
-Bruce
.

Jul 19 '05 #5
Have you tried executing the stored procedure in Query Analyzer?

<an*******@discussions.microsoft.com> wrote in message
news:9a****************************@phx.gbl...
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
-----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

-----Original Message-----

"Bruce Duncan" <an*******@discussions.microsoft.com>

wrote in message
news:8f****************************@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,

lcDisplayCatList
is
still = "Y"
Can anyone help point me in the right direction?

TIA
-Bruce

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

.

Jul 19 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Eli Sidwell | last post by:
Trying to return a Recordset to an ASP and the Recordset is empty. The StorredProc works in the query analyzer and it even works from a quick VB app that I wrote to test it. The storedproc that...
9
by: Phil W | last post by:
Hi all, Am having a bit of trouble with the @@identity field - I probably just have that friday feeling and am missing off something obvious, but the below code brings back am empty identity...
7
by: Jean | last post by:
Hello, I have a form that performs a search, according to criteria that a user enters into the text boxes. When the user clicks on „Search", a SQL string (say strSQL) is built up with the...
6
by: AAJ | last post by:
Hi all I have a listbox on a form. If I set its rowsource directly, and the query in the rowsourse returns no data, then the displayed listbox is empty (exactly as you would expect) ...
30
by: S. van Beek | last post by:
Dear reader A record set can be empty because the condition in the query delivers no records. Is there a VBA code to check the status of a record set, record set empty
0
ADezii
by: ADezii | last post by:
When you create a Recordset, you may want to know immediately whether that Recordset actually contains any Rows. There are Recordsets that don't return any Rows and you may need to take different...
0
by: berry | last post by:
Hi guys.. How to write the code 'if the datagrid is empty'? i using VisibleRows as shown as below. Hope any of you can look for it If Datagrid1.VisibleRows > 0 Then ...
2
by: hackmagic | last post by:
Hi, i have a form that normally has a Recordset containing only one record bound to it. i have replaced the navigation buttons with my own and the 'New Record' button assigns an empty Recordset...
3
by: Flo100 | last post by:
Hi, I have a recordset which I have populated with a query. I have an empty recordset. I would like to take value of a field in every single record, which is a string. Search if the 4rth...
4
by: ipez75 | last post by:
Hello everyone, I have a web application written in asp 6.0, my problem is that I execute a sql server store procedure and I get an empty recordset, while executing the same sp on query anlyzer I...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.