Database Source Name

Database Source Name

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. Included in the DSN, which resides either in the registry or as a separate text file, is information such as the name, directory and driver of the database, and, depending on the type of DSN, the ID and password of the user. 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 DSN (sometimes called machine DSN)

System DSN

File DSN

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.

= Example of use =Using a DSN to connect to a MySQL database through the Web, Web users can submit form entries to a MySQL database by establishing a connection to the MySQL database's DSN.

The advantage of a DSN is that applications can take advantage of any database, as long as DSN is supported (i.e. in Apache/PHP, IIS/ASP)

In ASP (VBScript), to open a DSN connection, the code is:

Dim DatabaseObject1 Set DatabaseObject1 = Server.CreateObject("ADODB.Connection") DatabaseObject1.Open("DSN=DSNname;")

In PHP using the PEAR::DB package, to open a DSN connection, the code is:

require_once("DB.php"); $dsn = "://:@/"; //$dsn = "mysql://john:pass@localhost/my_db"; $db = DB::connect($dsn);


Wikimedia Foundation. 2010.

Игры ⚽ Поможем написать курсовую

Look at other dictionaries:

  • Database Source Name — Der Data Source Name (DSN) ist eine Datenstruktur (ähnlich einer URL oder einem Dateipfad), welche bei Datenbankabstraktionsframeworks (Datenbankabstraktionsschicht) wie ODBC (Open Database Connectivity), JDBC oder ADOdb die Zugangsdaten… …   Deutsch Wikipedia

  • Data Source Name — In computing, a data source name (DSN, sometimes known as a database source name though data sources are not limited to databases) are data structures used to describe a connection to a data source. Most commonly used in reference to ODBC, DSNs… …   Wikipedia

  • Data Source Name — Der Data Source Name (DSN) ist eine Datenstruktur (ähnlich einer URL oder einem Dateipfad), welche bei Datenbankabstraktionsframeworks (Datenbankabstraktionsschicht) wie ODBC (Open Database Connectivity), JDBC oder ADOdb die Zugangsdaten… …   Deutsch Wikipedia

  • Database marketing — is a form of direct marketing using databases of customers or potential customers to generate personalized communications in order to promote a product or service for marketing purposes. The method of communication can be any addressable medium,… …   Wikipedia

  • Database Management Library — DBL Database Management Library Developer(s) ROCHA, Rodrigo C. O. Initial release July 2010 (2010 07) Stable release 1.0 / July 2, 2010; 15 months ago (2010 07 02) …   Wikipedia

  • Database — A database is an organized collection of data for one or more purposes, usually in digital form. The data are typically organized to model relevant aspects of reality (for example, the availability of rooms in hotels), in a way that supports… …   Wikipedia

  • Name Service Switch — The Name Service Switch (NSS) is a facility in Unix like operating systems that provides a variety of sources for common configuration databases and name resolution mechanisms. Such source databases include local operating system files, for… …   Wikipedia

  • Database management system — A database management system (DBMS) is a software package with computer programs that control the creation, maintenance, and the use of a database. It allows organizations to conveniently develop databases for various applications by database… …   Wikipedia

  • database — /day teuh bays /, n. 1. a comprehensive collection of related data organized for convenient access, generally in a computer. 2. See data bank. Also, data base, data base. [1965 70; DATA + BASE1] * * * Collection of data or information organized… …   Universalium

  • My Name Is Khan — Theatrical release poster Directed by Karan Johar Produced by …   Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”