2631Accessing database from an ASP pagehttp://www.stardeveloper.com/odbc_def.aspDatabases are a way of organizing and keeping your data. The data stored in databases can be anything from user email addresses to binary files. Databases have become so popular in the past decade that it is almost unimaginable to not to use them on the web.ASP > Tips and Tutorials > Database-relatedOct 10, 2006
This article offers an analysis of Structured Query Language (SQL) and presents techniques that can be used in building SQL statements. People tend to think of SQL as a programming language, but in reality, SQL is a Set language. One could say SQL is Set Theory or Relational Algebra; these terms are interchangeable. Some people think of this in terms of Venn diagrams or DeMorgan's Law. Although those can be quite complicated, the basic forms are not difficult to understand. The cases presented here are intended for certain circumstances, but they can be applied to many situations. Each article in this four-part series will address one case.
A stored procedure is nothing more than an sql statement stored inside a database. The database can be SQL Server or MS Access as well as others ... A stored procedure is compiled by your database (for the most part) one time, when it is entered. This results in faster database executions and overall performance updates... as an added bonus, it further separates the sql statement from your asp leaving you with more readable code. So let's get on with it.
ODBC is great and all but for speed and reliability you should switch to OLE DB to power your database driven apps. I will show you how to do it two ways: in the global.asa and in any ASP page.
A very good example is a form where the user needs to select a geographical region, a country within that region and a state within that country. If the user changes the geographical region, the countries and states within that geographical region need to be shown for selection
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.
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.