Wrox Home  
Search P2P Archive for: Go

  Return to Index  

access_asp thread: Filtering and tables


Message #1 by "Richard Walton" <campermanrich@h...> on Sat, 11 Jan 2003 23:59:41
Hi there, I'm trying to use a filter on a recordset within a table with 
only partial success. The filter works ok but seems to only appear inside 
the HTML table when i include it within a While Do loop! Heres a snippit 
of code..

<table border="1">
 <tr>
  <td>
   <%
     Dim rsArticle		
      strSQL= "SELECT ArticleID, Title from tblArticle"

          Set rsArticle = Server.CreateObject("ADODB.Recordset")
	  rsArticle.Open strSQL, objConn
	
          rsArticle.Filter = "ArticleID = '4'"
           Response.Write _
            "<FONT SIZE=2></FONT> " & rsArticle("Title") & "" & _	
%></td></tr></table>

If i place this in too it works! Why! ??? Cheers rIcH;)

<table border="1">
 <tr>
  <td>
   <%
     Dim rsArticle		
      strSQL= "SELECT ArticleID, Title from tblArticle"

          Set rsArticle = Server.CreateObject("ADODB.Recordset")
	  rsArticle.Open strSQL, objConn
	
          rsArticle.Filter = "ArticleID = '4'"
           Do While Not rsArticle.EOF
            Response.Write _
             "<FONT SIZE=2></FONT> " & rsArticle("Title") & "" & _
	rsArticle.Movenext
			Loop
%></td></tr></table>


 

  Return to Index