Setting Up a DSN W-O-G 2/10/00 Medium Free Web Hosting, Free Hosting, Free ASP Hosting - 1ASPHost.com
    

    Domain Registration
    Free Hosting
    Web Hosting
    E-mail Accounts
    FAQs
    Contact Us

    Learn ASP
    Databases
    Articles
    Terms of Service
    Home

An easy shortcut to connect to a database through ASP and the only way to do so with Cold Fusion, is to set up a Data Source Name(DSN). A DSN is basically a shortcut name that points o a database file on the server. Using a DSN makes it easier to open up a database in asp because you don't have to write a confusing connection string. All you have to do to open up a DB w/a DSN is:

Set conn = Server.CreateObject("ADODB.Connection")
conn.open "DSN=thedsnname"

See, a lot simpler except it takes a minutes to set up a DSN and usually you have to get the server ADMIN to do it. DomainDLX does not support DSN, due to the large amount of members.  

The first step is to open up the Windows NT or 9x or 2000 control panel and click on the ODBC Datasources(32-bit) icon (shown right). Next, click on the System DSN tab (left) and click the Add... button.

Next, the following screen will appear, just select the database format you are going to use and click .

After you click finish, the dialogue shown to the right will appear, type in the name you want to be your DSN in the DATA SOURCE NAME textbox. You don't really need to give it a description but you can if you want. Now hit the button and browse or type in the location of the database on the server's hard drive. Click OK. Then your done! If you set a username and password for the database, you will need to click the on the right and type in the user ID and password.