DSN-less connections
Active Data Objects Data Base (ADODB) is a PHP database class library, which is used to connect to different databases (MSSQL, MySQL, Access, Oracle etc). The real advantage is when it comes to migration from one database to another. The same PHP code can be used without being changing much. All that is required is to change the driver specifications. This tutorial will give you an outline about using ADODB in PHP.
Before we begin let me give you a quick intro about what a DNS and ODBC is.
DSN
A data source name (DSN) is a data structure that contains the information about a specific database that an Open Database Connectivity (ODBC) driver needs in order to connect to it. The developer creates a separate DSN for each database. To connect to a particular database, the developer specifies its DSN within a program. In contrast, DSN-less connections require that all the necessary information be specified within the program.
There are three kinds of DSN: user DSNs (sometimes called machine DSNs) system DSNs file DSNs.
User and system DSNs are specific to a particular computer, and store DSN information in the registry. A user DSN allows database access for a single user on a single computer, and a system DSN for any user of a particular computer. A file DSN contains the relevant information within a text file with a .DSN file extension, and can be shared by users of different computers who have the same drivers installed.
ODBC
Open Database Connectivity (ODBC) is an open standard application-programming interface (API) for accessing a database. By using ODBC statements in a program, you can access files in a number of different databases, including Access, dBase, DB2, Excel, and Text. In addition to the ODBC software, a separate module or driver is needed for each database to be accessed.

| Hits: | 67 | Last Updated: | 2006-07-08 |
VIEW ALL
PHP Tutorials