Check out the code for filtering ADO recordset
- From: "nisman" <nm.nishant@xxxxxxxxx>
- Date: 20 Nov 2006 01:31:06 -0800
Pls check out the code for filterring ADO recordset.
Complete code sourced from ;
http://techzone.izine.in/forum/forum_posts.asp?TID=25
<HTML>
<HEAD><TITLE>Place Document Title Here</TITLE></HEAD>
<BODY BGColor=ffffff Text=000000>
<%
Set cn = Server.CreateObject("ADODB.Connection")
Set rs = Server.CreateObject("ADODB.RecordSet")
cn.Open Application("guestDSN")
rs.ActiveConnection = cn
rs.CursorType = adOpenStatic
rs.LockType = adLockOptimistic
rs.Source = "SELECT * FROM authors"
rs.Open
%>
<TABLE BORDER=1>
<TR>
<TH Colspan=<%= rs.Fields.Count %>><B>Before Filter</B></TH>
</TR>
<TR>
<% For i = 0 To RS.Fields.Count - 1 %>
<TD><B><%= RS(i).Name %></B></TD>
<% Next %>
</TR>
<% Do While Not RS.EOF %>
<TR>
<% For i = 0 To RS.Fields.Count - 1 %>
<TD><%= RS(i) %></TD>
<% Next %>
</TR>
<%
RS.MoveNext
Loop
rs.Filter = "phone LIKE '415%'"
rs.MoveFirst
%>
</TABLE>
<P>
<TABLE BORDER=1>
<TR>
<TH Colspan=<%= rs.Fields.Count %>><B>After Filter</B></TH>
</TR>
<TR>
<% For i = 0 To RS.Fields.Count - 1 %>
<TD><B><%= RS(i).Name %></B></TD>
<% Next %>
</TR>
<% Do While Not RS.EOF %>
<TR>
<% For i = 0 To RS.Fields.Count - 1%>
<TD><%= RS(i) %></TD>
<% Next %>
</TR>
<%
RS.MoveNext
Loop
rs.MoveFirst
RS.Close
Cn.Close
%>
</TABLE>
.
- Follow-Ups:
- Re: Check out the code for filtering ADO recordset
- From: Bob Barrows [MVP]
- Re: Check out the code for filtering ADO recordset
- Prev by Date: Re: Dis-instantiating a form object having connections
- Next by Date: Re: Check out the code for filtering ADO recordset
- Previous by thread: Dis-instantiating a form object having connections
- Next by thread: Re: Check out the code for filtering ADO recordset
- Index(es):