Now everybody can connect to a database. Simple database access is a huge feature of ASP and one of the most widely used by developers but when you are first learning, it‘s hard to separate the database stuff from the rest of the code so I made this example. I even removed the includes and everything.
Sometimes we worry about limits of database table and we need to know how manay recods we have. In ASP we could count all recods using a loop. But if we have a small piece of knowledge about SQL script, our script works better and faster.
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.
You can use transactions in ASP as a kind of insurance policy for your database activities, making them safer and providing better error recovery. Transactions are most useful when doing multiple actions on multiple tables. The example below shows just how easy it is to use transactions from ASP, inserting a record into a table and doing a "rollback" if there's a problem.
This example shows how to perform a variety of statistics on your data using simple SQL such as Sum, Average, Max, Min, and Count. It uses stock trading performance of EPOS as an example.
This source code displays results dividing to pages. Code provides Next Previous page links with numeric page numbers. You may modify source code to use with MS SQL or MS Access database. For this example, we have used MS SQL Server using sample database Northwind.
The power of Active Server Pages comes through when we tie databases to our web sites. To connect to a database, ASP uses what is called ActiveX Data Objects, or ADO for short. ADO comes with ASP, and can be used easily from your ASP pages. In this tutorial we will show you how to connect to Access database and retrieve all the records from the table.
If you are developing a password-protected web site, you have to make a decision about how to store user password information securely. This article will show you how to encrypt user passwords with md5 algorithm and how to start using encrypted passwords if you already have users' database ready.