123 Eng

Engineering the engineers™


Latest Jobs   Forum Map

 


Home

Source Codes

Engineering Colleges

BE Students

Training  Reports (updated)

Seminar Reports (updated

Placement Papers (updated)

Forums

   Computer Science / IT

   Electronics

   Electrical

   Mechanical

   Chemical

   Civil

   CAT / MBA

   GMAT / Foreign MBA

Latest Jobs

Engineering Jobs / Technical Jobs

Management Jobs

Sitemap

About-Us

Terms of use

Displaying  Source Code(s)  
 

 
How to filter a recordset

--------------------------------------------------------------------------------

Description : Here is how to filter an ADO Recordset.

<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>
 

 

 

Contribute content or training reports / feedback / Comments
job placement papers
All rights reserved © copyright 123ENG