1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Record count in a query

Discussion in 'C#' started by minciamia, Mar 22, 2008.

  1. #1
    HI: i have a question about how to insert a record count in an already existing query in ASP :)

    Here's the (working) code:
    SEMrush
    
    <!-- #include file="header.inc" -->
    
    <%
    u_search=request.form("u_search")
    u_where=request.form("u_where")
    if u_search = "" or u_where= "" then 
    response.redirect "default.asp"
    
    end if
    accessdb="/mdb-database/database.mdb" 
    cn="DRIVER={Microsoft Access Driver (*.mdb)};"
    cn=cn & "DBQ=" & server.mappath(accessdb)
    Set rs = Server.CreateObject("ADODB.Recordset")
    
    sql = "select * from tblNews where " & u_where &" like '%%"& u_search & "%%'" 
    
    rs.Open sql, cn
    If  rs.eof then
       search="nothing"
    end if
    %>
    
    <title>Search results</title>
    <body>
    <% if search <> "nothing" then %>
    <img border="0" src="news_images/icons/results.png" width="32" height="32">Results found!</font><br>
    
    <% end if %>
    <%
    On Error Resume Next
    rs.MoveFirst
    do while Not rs.eof
    %>
    
    
    Abstract: </font><b> <%= rs("abstract") %></b><br>
    
    Date of publication: <%= rs("date_of_publication") %><br>
    
    
    
    
    
    <%
    rs.MoveNext
    loop%>
    
    <% if search = "nothing" then %>
    
    	<p align=center><img border="0" src="news_images/icons/noresults.png" width="32" height="32">No Search Results Matched</font> "<font color=#CC3300><b><%= u_search %></font></b>"</td></p>
    <% end if %></table></center><!--#include file="footer.inc"-->
    Code (markup):
    I wish to insert a record count for the results found: please, someone could be so kind to help me? Thanks in advance. :)
     
    minciamia, Mar 22, 2008 IP
    SEMrush
  2. minciamia

    minciamia Peon

    Messages:
    3
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Ooopps!! Sorry, i've already found out how to do.
    I apologize for opening an useless thread :eek:
     
    minciamia, Mar 22, 2008 IP