Finding Matching Records in Data Access Pages
(Page 1 of 4 )
In many types of customer service applications the main interest is in finding a record matching a certain value provided by the customer in the form of a customer identifier such as a Social Security number, a telephone number or other means. This kind of functionality can be implemented in Data Access Pages (DAP) by using the document object model of the various client objects combined with the Find() method of the RecordSet object.
In a scenario such as the above, it is possible to populate a combo-box control with all the available customer identifiers and pick the one for the customer in question to get the information. Sometimes for security reasons this solution may not be acceptable, in which case the customer information representative would just type the information provided by the customer into an empty textbox, and the event raised by this action is used to find the information.
In Data Access Pages, the data is retrieved in the form of tables and queries constituting the "Field List" of the Data Access Page. The "Field List" objects can be dragged and dropped onto the design pane of the DAP. The data is in the form of a record set which can be set to represent the DefaultRecordset for the MSODSC control that controls the data on the DAP. Also the various objects on the DAP are part of the client objects, with rich properties and events. It is possible to program these using the JavaScript (Jscript's) DOM model, or using the ECMA Script.
This tutorial looks at the implementation of finding records in a table using both the Combo-box and the text-box control as the source of the text used for matching. This tutorial was prompted in part by the questions posed to some of the article blogs at this site.
Creating a Data Access Page using the Wizard
It will be useful for the reader to review the following articles in this site so that the present article will be little easier to understand:
For purposes of illustration a new blank data base project is created into which the Employees table from an existing Northwind database will be imported. You will find the Northwind database in the Office folder of your computer. In the first example, the DAP will use a textbox control in addition to the various field objects. This textbox is used to find the keyword typed into this box; once the keyword is found, all the column elements for that row will be returned and displayed on the DAP. In the second case combo-boxes reveal existing entries for a keyword; when a particular keyword is selected, the entire row will be retrieved.
Next: Using a textbox to find matching records >>
More Database Code Articles
More By Jayaram Krishnaswamy
|
| · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | | |
|