2617Multiple Form Selectionhttp://www.codeave.com/asp/code.asp?u_log=125Allowing 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.ASP > Tips and Tutorials > Database-relatedOct 10, 2006
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:
Learn how to select a record from database. First we need to calculate how many records we have in our table. Using randomize function, we generate a random number between 0 to count of records in database.
DSN Connections
In my earlier article on Accessing the database from ASP I explained connecting to database via DSN in a step by step mannner. So there is no need to repeat that again, you can see it from there.
DSN stands for 'Data Source Name'. It is an easy way to assign useful and easily rememberable names to data sources which may not be limited to databases alone e.g Excel spread sheet etc.
I will now skip the steps of creating and assigning DSN to a database, you can see them by clicking here. Once you are done creating a DSN for your data source ( database lets say ), you can connect to it using following code
You can connect to an Access database within an ASP page with different methods. This article will help you to create a System Data Source Name (DSN) for an Access database on your local machine.
Open Control Panel window, you will see different icons as shown in Pic 1.
Doubble click on ODBC Data Source Administrator icon.
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.
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.