Database Code
  Home arrow Database Code arrow Page 3 - 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 
VeriSign Whitepapers 
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 / 9
    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

    Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here

    Finding Matching Records in Data Access Pages - The code page and the code to search the EmployeeID


    (Page 3 of 4 )

    Now open up the Microsoft Script Editor as shown with all elements showing at the top of this picture. The "Document Outline" window shows all the objects on this DAP relating to the data-related objects as well as any control element you placed on the page (in this case, a textbox was placed).

    Now scroll down until you come to the textbox whose ID is IdEmp as shown in the next picture.

    Since this is a textbox, the onchange event is a natural event that is invoked when you type something into the textbox and step out of it. Double click the onchange event in the "Document Outline." This opens up a region in the Microsoft Script Editor and places a vbscript-related tag for that particular element as shown.

    Now what is required is to code in such a way that the EmployeeID field in the recordset will be searched until the text typed in the box whose id is "IdEmp" is found. The following code does just that. The script is vbscript and it is written for the "onchange" event of the object whose Id is "IdEmp." The language syntax is Microsoft's, which can be recognized by the "document.all.item()" method and is IE specific. As mentioned previously, the data in the DAP is passed to the MSODSC's default recordset. This is all that is needed to find all the information for this EmployeeID.

    Testing this code

    Open the page in preview mode, which will require you to save it first. This page is already saved as "TestEmployees.htm." When this is opened the employee information for the employee whose IdEmp =1 will be showing, and the textbox will be empty. Type a number (there are only nine employees in this table) and step out of the box and you will see the record for the employee displayed as shown. The picture as shown is for the number 6 typed into the textbox.

    More Database Code Articles
    More By Jayaram Krishnaswamy


       · 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 5 hosted by Hostway