In the tutorials so far we have learned from connecting to the database via ASP to inerting, updating and selecting data from the database.
The area we waste a lot of database time is when we show records to the user and in the mean time keep our database connection open. Following example illustrates this point :
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.
Many a time, you are confronted with creating a system DSN for use with ASP. If you have an ISP account, this might take time and more than sometimes - money. This article describes how to use File DSNs and save time and money. Also, you can reuse these DSNs and thus, with some modifications, use the same DSN for as many database connections.
Sum function can be used for to get the sum of a numeric expression evaluated over a set. This function must be placed in an SQL statement. Following example will return the sum of ratings in articles.
In this example we have used our old database. There was a rating column holding the votes of our articles. We were using this simple script to check sum of ratings.
In this article we will see on how to search the database for a group of records. Searching a database is very easy and fun provided you know how to do it. Many of you who know SQL will already be doing it. But I will not use any lengthy SQL statements, instead will use some very useful Recordset object properties; Filter and Sort
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.