2532Paging Records using GetRowshttp://www.devhome.org/asp/As databases grow in size, displaying information in organized, consumable "chunks" becomes more and more difficult. For example, if a database table contains thousands or even hundreds of rows, simply dumping the entire contents of the table can overwhelm the user and be difficult to pick through. As developers it is our job to provide information in digestible quantities. One common solution is to page database table results. That is, only a small number of database records are shown per screen, accompanied by Next and Previous buttons allowing the user to step through the database results in sensible steps.
There are already a number of great 4Guys articles on paging database records. If you are using SQL Server it is strongly recommended that you use a stored procedure-based approach, as outlined in the article Paging through Records Using a Stored Procedure. A script that uses AbsolutePage, PageSize, and PageCount (three ADO properties designed to allow for paging) can be seen at Paged Table Display, authored by Charles Carroll and Jeff Emrich.
This article provides an alternative way to page through database records. This technique uses the GetRows method of the Recordset object. GetRows dumps the Recordset data into a two-dimensional array. The first dimension of the array stores the column information while the second dimension stores the row information. The following snippet of code illustrates how to use GetRows:ASP > Tips and Tutorials > Database-relatedOct 10, 2006
Allowing multiple choices of data elements enables people to customize views of your data and adds value to your applications. The following example utilizes our db on the career statistics of Hammerin? Hank Greenberg. The year and team he played with are already part of the sql request to the db. User inputted choice(s) are added to the basic sql statement to draw them from the db. Since the input from the dropdown menu comes through comma delimited it is simply written into the statement without modification. Two simple for next loops determine which elements are part of the record set and displays them accordingly.
Filter method is very useful working with large datasets. You might need to put only some records from your database but you should select all data from database. Fileter method is advantage working on recordsets after querying on SQL command.
When you're querying a Db typically you're looking for an exact match (=), less than (<), greater than (>), less than or equal to (<=), greater than or equal to (=>), or not equal to (< >). Which give you quite a number of ways that you can display your data, but with these operators a partial match is not allowed. In order to facilitate a partial match the like operator must be used and it's entirely up to you how that match is made. The example db contains most of the Titles, AirDates and What Bart Simpson writes in the blackboard at the beginning of The Simpson's (TM).
source code can compact and repair your MS-Access database files. If you compact your access files regularly, it will work more faster and secure. Also you will save some hard disk space.
There are a great many statistics that you can perform on your data with simple sql. Sum, Average, Max, Min, and Count can be derived nearly as easy as showing the complete detail of your data. The following example utilizes our db (trade date, closing price and daily volume) of EPOS (@PointofSale.com) stock trading performance. Each of the statistics are available in a dropdown menu and the sql that is used on the daily volume is displayed.
Joining mailing list will entitle you
to receive occasional emails informing you of news and
updates to the site and any special offers that may be
of interest to you.