D.2 Database Connectivity Features

A primary use of Chili!Soft ASP is to enable information stored in a database to be displayed and manipulated via the Web. With Chili!Soft ASP for UNIX and Linux database connections are typically defined by creating data source names (DSNs) in the ODBC.INI file. There can be only one ODBC.INI file for each installation of Chili!Soft ASP. Defining DSNs in ODBC.INI is most appropriate in a dedicated Web hosting environment. In a shared environment, putting a DSN (including a username and password for the database) in the ODBC.INI makes the data source accessible from any ASP page on the server. Furthermore, in a shared environment, creating DSNs for each customer in ODBC.INI would be a significant burden for the Web hosting company.
As an alternative to ODBC.INI, ASP developers can use "DSN-less" data connections. With DSN-less connections, all of the information needed to connect to a data source is either in the connection string or in a File DSN referred to in the connection string. For example, instead of an ASP page using a database connection like:
Connect_String = "DSN=MyDatabase"
the user can use a connection string like:
Connect_String = "Driver={Microsoft dBase Driver (*.dbf)}; _
DBQ = /path/to/data; DefaultDir=/path/to/data"
The ASP developer could also use a File DSN as follows:
Connect_String = "FILEDSN=/path/to/MyDatabase.dsn"
where MyDatabase.dsn contains all of the database connection string information that would normally be contained in the ODBC.INI file. The use of File DSNs is typically the most secure approach, because the File DSN can contain the user name and password for the database, and when Chili!Soft ASP is running in Inherited User mode, it can only open the file containing the DSN if it is running as a user with permission to open the file.
Copyright © 2000 Chili!Soft
|