Creating a DSN

Domain Hosting image
Web Hosting
Dedicated server
ssl certificate
Web Design image
Email

The win32::ODBC module and other ODBC applications connect to your Access database through a Data Source Name (DSN). For CDBC to work across many different database engines, it requires a standard way to communicate with all database. The DSN contains a common set of information that all databases must supply. You must create the DSN on your computer before you can begin connecting your program to your database.

The DSN supplies the following information:
The location of the database
The type of database driver (Microsoft Access in our example)
User name and Password information

There are two primary types of DSNs:

A User DSN is accessible by only the account that created it. If you are creating DSN for your own use, you should create a User DSN.

A System DSN is accessible by any account. If you are creating a DSN that will be used by multiple users, you should create a System DSN.

The DSN created for our examples will eventually be accessed through a web server, so it should be a System DSN.

You can create a DSN through the Windows Control Panel or by using the win32: ODBC module. The following section describe the procedure to create DSN using Windows Control Panel.

Using the Control Panel

To create DSN for your Access database, open your Control Panel and click on the ODBC icon. Clicking on the ODBC icon brings up the ODBC Data Source Administrator, which is used to define and configure DSN entries. Select the System DSN tab and then click on the Add button to bring up the Create New Data Source dialog box. In this dialog box, select the specific driver used for your database engine.

Selecting the Microsoft Access driver brings up the ODBC Microsoft Access 97 Setup dialog box. Here, you enter the name of your DSN, which is the same name you will use in your program to reference the DSN. You also can enter a brief description of the DSN. Then select the Database radio button in the System Database portion of the dialog box and click on the System Database button The Select System Database dialog box appears. Navigate to the directory that contains your database and select it.



Domain Name Search

www.


Copyright (C) 2007. Web Domain design hosting. All rights reserved.