Database Code
  Home arrow Database Code arrow Page 4 - Finding Matching Records in Data Access Pa...
ASP Free Forums 
.NET  
ASP  
ASP Code  
ASP.NET  
ASP.NET Code  
BrainDump  
C#  
Code Examples  
Database  
Database Code  
IIS  
Microsoft Access  
MS SQL Server  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
ASP Web Hosting  
ASP.NET Web Hosting 
Dedicated Servers 
Actuate Whitepapers 
Moblin 
Windows Web Hosting
 
IBM® developerWorks 
Sun Developer Network 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
DATABASE CODE

Finding Matching Records in Data Access Pages
By: Jayaram Krishnaswamy
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 10
    2006-12-12

    Table of Contents:
  • Finding Matching Records in Data Access Pages
  • Using a textbox to find matching records
  • The code page and the code to search the EmployeeID
  • Using Combo boxes to find records

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT

    Free Web 2.0 Code Generator! Generate data entry and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!

    Finding Matching Records in Data Access Pages - Using Combo boxes to find records


    (Page 4 of 4 )

    Since the previous example has been described in considerable detail, only some relevant screen shots will be shown and the coding will be similar to the previous example except that instead of a textbox there will be two combo-boxes whose properties will be set in such a way that they get populated by the EmployeeID in one, and by FirstName in the other. Again the code will be written to those elements by following up their ids in the "Document Outline."

    The design view of Employees.htm

    The next picture shows the design view of the Employee.htm which has a different recordset. Two combo-boxes have been added to this page, the same way the textbox was added in the previous example. Their labels have been changed to reflect what is achieved by picking something from the combo-box. The picture also shows the setting for one of the combo-boxes (EmployeeID). The drop-down list has an ID property. The combo-box gets tied to the EmployeeID field and since its source is Recordset:Employees, when the page is shown in preview, the combo-box gets populated by the EmployeeID. In a similar way, the FirstName combo-box gets populated by the Employee First Names.

    The code for finding the specified FirstName

    The FirstName combo box has been given an id, Ename. The next picture shows the vbscript code for the onchange event of this object. When you write the code make sure the id matches correctly as shown. Again the routine for finding the Ename is the same except that the combo-box's onchange event is used and the code is written for this event. The Find() method can take three other optional arguments.

    Testing this code

    Open the page using the View menu option. By choosing a FirstName or an EmployeeID name, you can bring up the record corresponding to that FirstName or the EmployeeID as shown for the Employee whose FirstName is Steven. It may be noticed that the navigation control is hidden, which you can do in the design. However the navigation will be effective if you want to use because it is bound to the recordset.

    Summary

    It is quite easy to find records bound to Data Access Pages using the Recordset's Find() method as shown in this article. If you need to hide data from prying eyes you may just have an empty textbox, but now you need to enter the correct information. No validation has been set for the textbox, which you must include to prevent runtime error in your code. Both examples could be implemented in the same DAP. It was shown separately in this tutorial for reasons of clarity.


    DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware.

       · Implementing parametric queries using DAPs as discussed in an earlier tutorial...
       · I found the above article exactly what I was looking for. However on page 3 of the...
       · thanks for your best articlebut what is your following source code? :-)
       · if so, could you please pass it on?thanks,m
       · did you ever find the code?
       · I was also unable to find the code you referred to on page 3. Am I overlooking...
       · No, I never heard from the author nor have I ever found the source code....
       · This Topic does not provide stifaction for the reader. It's doesn't contain complete...
       · Haha, the code is in the article without the html characters being escaped so it...
       · Hopefully this works. You can also view source to see it.


     

    DATABASE CODE ARTICLES

    - Deployment of the MobiLink Synchronization M...
    - MobiLink Synchronization Wizard in SQL Anywh...
    - Finding Matching Records in Data Access Pages
    - Using the AccessDataSource Control in VS 2005
    - A Closer Look at ADO.NET: The Command Object
    - A Closer Look at ADO.NET: The Connection Obj...
    - Using ADO to Communicate with the Database, ...
    - Code Snippets: Counting Records
    - Constraints In Microsoft SQL Server 2000
    - Multilingual entries into a DB and to be dis...
    - Getting A List of Tables From SQL Server
    - SQL Server Database Creator - .NET Version
    - ADO Recordset Paging
    - Two combos, one textbox example
    - Discussion & Listserv Module by Mike Eck...





    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway