A Database Framework with ASP
By Marco Tabini
While so-called dynamic Web sites have gained in popularity over the past year, these database-generated sites take time to design and set up. While Microsoft's Active Server Pages (ASP) have made creating dynamic Web sites much easier, many of the tasks are common to any database application and can therefore be abstracted. Realizing this, I recently created an ASP-based database query system composed of only six pages, called Web2SQL, that can also serve as a template for building dynamic Web sites. You can use Web2SQL to access and manipulate any Microsoft SQL database. With just a few changes, any Open Database Connectivity (ODBC) compatible database.
Designing the System
ODBC generally describes database connections through specialized structures called "datasources" (DSNs). Each DSN contains information such as what kind of database it points to, the location of the database provider (the network address of a SQL server or the path of an Access file, for example), login name, password, and so on. A single datasource can be used only to access a specific database residing on a specific server. Unfortunately, this hard coding of datasources defeats our purpose of generating pages dynamically. One solution is to create database connections that don't rely on the datasource. Such connections are known as DSN-less connections, and are created by specifying a particular connection string before calling the Open method of the connection component as shown in