Number of rows returned by database query

Number of rows returned by database query

Post by Jonathan Blit » Mon, 13 Jan 2003 18:39:13



Is there any way I can know the numer of rows returned by a database query?

I need to know if it is 0 so as to hide buttons.

Jonathan Blitz
AnyKey Limited
Israel

 
 
 

Number of rows returned by database query

Post by Kathleen Anderso » Mon, 13 Jan 2003 21:43:35


If there are no records returned, there are no buttons either.

--

~ Kathleen Anderson
Microsoft MVP - FrontPage
Spider Web Woman Designs
http://www.spiderwebwoman.com/resources/
Microsoft? FrontPage? Newsgroups FAQ
http://www.net-sites.com/sitebuilder/newsgroups.asp


> Is there any way I can know the numer of rows returned by a database
> query?

> I need to know if it is 0 so as to hide buttons.

> Jonathan Blitz
> AnyKey Limited
> Israel


 
 
 

Number of rows returned by database query

Post by Jonathan Blit » Tue, 14 Jan 2003 04:30:50


I am talking about buttons I add myself - not directly connected to the rows
selected.

Is there no variable that indicates the number of rows returned?


If there are no records returned, there are no buttons either.

--

~ Kathleen Anderson
Microsoft MVP - FrontPage
Spider Web Woman Designs
http://www.spiderwebwoman.com/resources/
Microsoft? FrontPage? Newsgroups FAQ
http://www.net-sites.com/sitebuilder/newsgroups.asp


> Is there any way I can know the numer of rows returned by a database
> query?

> I need to know if it is 0 so as to hide buttons.

> Jonathan Blitz
> AnyKey Limited
> Israel

 
 
 

Number of rows returned by database query

Post by Kathleen Anderso » Tue, 14 Jan 2003 05:02:35


You could add another DRW to your page to count the numbers of records returned and if it's greater than zero, write out your buttons using some script.

--
~ Kathleen Anderson
MVP FrontPage


> I am talking about buttons I add myself - not directly connected to
> the rows selected.

> Is there no variable that indicates the number of rows returned?



> If there are no records returned, there are no buttons either.


>> Is there any way I can know the numer of rows returned by a database
>> query?

>> I need to know if it is 0 so as to hide buttons.

>> Jonathan Blitz
>> AnyKey Limited
>> Israel

 
 
 

Number of rows returned by database query

Post by Jonathan Blit » Tue, 14 Jan 2003 05:13:53


Was hoping there was something simpler.
:(


You could add another DRW to your page to count the numbers of records
returned and if it's greater than zero, write out your buttons using some
script.

--
~ Kathleen Anderson
MVP FrontPage


> I am talking about buttons I add myself - not directly connected to
> the rows selected.

> Is there no variable that indicates the number of rows returned?



> If there are no records returned, there are no buttons either.


>> Is there any way I can know the numer of rows returned by a database
>> query?

>> I need to know if it is 0 so as to hide buttons.

>> Jonathan Blitz
>> AnyKey Limited
>> Israel

 
 
 

Number of rows returned by database query

Post by Stephen Travi » Tue, 14 Jan 2003 22:14:45


Place this script inside of your DRW;

<%count = fp_rs.RecordCount%>

--

Stephen Travis,
Microsoft MVP - FrontPage


> I am talking about buttons I add myself - not directly connected to the rows
> selected.

> Is there no variable that indicates the number of rows returned?



> If there are no records returned, there are no buttons either.

> --

> ~ Kathleen Anderson
> Microsoft MVP - FrontPage
> Spider Web Woman Designs
> http://www.spiderwebwoman.com/resources/
> Microsoft? FrontPage? Newsgroups FAQ
> http://www.net-sites.com/sitebuilder/newsgroups.asp


> > Is there any way I can know the numer of rows returned by a database
> > query?

> > I need to know if it is 0 so as to hide buttons.

> > Jonathan Blitz
> > AnyKey Limited
> > Israel

 
 
 

Number of rows returned by database query

Post by Jonathan Blit » Tue, 14 Jan 2003 23:20:15


What I am tring to do is make a button appear only if there are rows
returned from s query.
So in the DRW are I have entered the following:

<% if fp_rs.RecordCount != 0 then %>
   <a onclick="location =
'DealerHistoryDisplay.asp?DealerCode=<%=FP_FieldURL(fp_rs,"InhouseCode")%>&V
isitId=<%=FP_FieldURL(fp_rs,"VisitId")%>'">
        <button name="Next" style="width: 80; height:
30">Next</button></a></p>
<% end if %>


> Place this script inside of your DRW;

> <%count = fp_rs.RecordCount%>

> --

> Stephen Travis,
> Microsoft MVP - FrontPage




> > I am talking about buttons I add myself - not directly connected to the
rows
> > selected.

> > Is there no variable that indicates the number of rows returned?



> > If there are no records returned, there are no buttons either.

> > --

> > ~ Kathleen Anderson
> > Microsoft MVP - FrontPage
> > Spider Web Woman Designs
> > http://www.spiderwebwoman.com/resources/
> > Microsoft? FrontPage? Newsgroups FAQ
> > http://www.net-sites.com/sitebuilder/newsgroups.asp


> > > Is there any way I can know the numer of rows returned by a database
> > > query?

> > > I need to know if it is 0 so as to hide buttons.

> > > Jonathan Blitz
> > > AnyKey Limited
> > > Israel

 
 
 

Number of rows returned by database query

Post by Stephen Travi » Tue, 14 Jan 2003 23:43:17


Fine.

--

Stephen Travis,
Microsoft MVP - FrontPage


> What I am tring to do is make a button appear only if there are rows
> returned from s query.
> So in the DRW are I have entered the following:

> <% if fp_rs.RecordCount != 0 then %>
>    <a onclick="location =
> 'DealerHistoryDisplay.asp?DealerCode=<%=FP_FieldURL(fp_rs,"InhouseCode")%>&V
> isitId=<%=FP_FieldURL(fp_rs,"VisitId")%>'">
>         <button name="Next" style="width: 80; height:
> 30">Next</button></a></p>
> <% end if %>



> > Place this script inside of your DRW;

> > <%count = fp_rs.RecordCount%>

> > --

> > Stephen Travis,
> > Microsoft MVP - FrontPage



> > > I am talking about buttons I add myself - not directly connected to the
> rows
> > > selected.

> > > Is there no variable that indicates the number of rows returned?



> > > If there are no records returned, there are no buttons either.

> > > --

> > > ~ Kathleen Anderson
> > > Microsoft MVP - FrontPage
> > > Spider Web Woman Designs
> > > http://www.spiderwebwoman.com/resources/
> > > Microsoft? FrontPage? Newsgroups FAQ
> > > http://www.net-sites.com/sitebuilder/newsgroups.asp


> > > > Is there any way I can know the numer of rows returned by a database
> > > > query?

> > > > I need to know if it is 0 so as to hide buttons.

> > > > Jonathan Blitz
> > > > AnyKey Limited
> > > > Israel

 
 
 

Number of rows returned by database query

Post by Jonathan Blit » Wed, 15 Jan 2003 00:41:41


Forgot to mention that it doesn't work. :)
Get error on page.


> Fine.

> --

> Stephen Travis,
> Microsoft MVP - FrontPage




Quote:> > What I am tring to do is make a button appear only if there are rows
> > returned from s query.
> > So in the DRW are I have entered the following:

> > <% if fp_rs.RecordCount != 0 then %>
> >    <a onclick="location =

'DealerHistoryDisplay.asp?DealerCode=<%=FP_FieldURL(fp_rs,"InhouseCode")%>&V
> > isitId=<%=FP_FieldURL(fp_rs,"VisitId")%>'">
> >         <button name="Next" style="width: 80; height:
> > 30">Next</button></a></p>
> > <% end if %>



> > > Place this script inside of your DRW;

> > > <%count = fp_rs.RecordCount%>

> > > --

> > > Stephen Travis,
> > > Microsoft MVP - FrontPage



> > > > I am talking about buttons I add myself - not directly connected to
the
> > rows
> > > > selected.

> > > > Is there no variable that indicates the number of rows returned?



> > > > If there are no records returned, there are no buttons either.

> > > > --

> > > > ~ Kathleen Anderson
> > > > Microsoft MVP - FrontPage
> > > > Spider Web Woman Designs
> > > > http://www.spiderwebwoman.com/resources/
> > > > Microsoft? FrontPage? Newsgroups FAQ
> > > > http://www.net-sites.com/sitebuilder/newsgroups.asp


> > > > > Is there any way I can know the numer of rows returned by a
database
> > > > > query?

> > > > > I need to know if it is 0 so as to hide buttons.

> > > > > Jonathan Blitz
> > > > > AnyKey Limited
> > > > > Israel

 
 
 

Number of rows returned by database query

Post by Stephen Travi » Wed, 15 Jan 2003 00:48:30


The recordCount property isn't always available, depending on your db and provider. Try to just display the record count to see if
it's available;

<p>There are a total of <%=fp_rs.RecordCount%> records.</p>

--

Stephen Travis,
Microsoft MVP - FrontPage


> Forgot to mention that it doesn't work. :)
> Get error on page.



> > Fine.

> > --

> > Stephen Travis,
> > Microsoft MVP - FrontPage



> > > What I am tring to do is make a button appear only if there are rows
> > > returned from s query.
> > > So in the DRW are I have entered the following:

> > > <% if fp_rs.RecordCount != 0 then %>
> > >    <a onclick="location =

> 'DealerHistoryDisplay.asp?DealerCode=<%=FP_FieldURL(fp_rs,"InhouseCode")%>&V
> > > isitId=<%=FP_FieldURL(fp_rs,"VisitId")%>'">
> > >         <button name="Next" style="width: 80; height:
> > > 30">Next</button></a></p>
> > > <% end if %>



> > > > Place this script inside of your DRW;

> > > > <%count = fp_rs.RecordCount%>

> > > > --

> > > > Stephen Travis,
> > > > Microsoft MVP - FrontPage



> > > > > I am talking about buttons I add myself - not directly connected to
> the
> > > rows
> > > > > selected.

> > > > > Is there no variable that indicates the number of rows returned?



> > > > > If there are no records returned, there are no buttons either.

> > > > > --

> > > > > ~ Kathleen Anderson
> > > > > Microsoft MVP - FrontPage
> > > > > Spider Web Woman Designs
> > > > > http://www.spiderwebwoman.com/resources/
> > > > > Microsoft? FrontPage? Newsgroups FAQ
> > > > > http://www.net-sites.com/sitebuilder/newsgroups.asp


> > > > > > Is there any way I can know the numer of rows returned by a
> database
> > > > > > query?

> > > > > > I need to know if it is 0 so as to hide buttons.

> > > > > > Jonathan Blitz
> > > > > > AnyKey Limited
> > > > > > Israel