SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Thread: Dsn

  1. #1
    SitePoint Member
    Join Date
    May 2000
    Location
    Bhopal MP India
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    this question might stupid.
    what is DSN? what is the nesscesary to use it. without it also i can connect to database.

    Thanks in advance.

  2. #2
    SitePoint Addict djh's Avatar
    Join Date
    Apr 2000
    Location
    Long Beach, CA
    Posts
    333
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    DSN stands for Data Source Name. You don't have to have a DSN to connect to a database; you can get more info on a DSN-less connection string from 4guysfromrolla.

    If you do decide to use a DSN, you need to change (add) the setting in your ODBC component of your control panel. You can also get more info from 4guysfromrolla...

  3. #3
    Your Lord and Master, Foamy gold trophy Hierophant's Avatar
    Join Date
    Aug 1999
    Location
    Lancaster, Ca. USA
    Posts
    12,305
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    DSN connections are slower than DSN-less connections because you have an extra layer between you and the ODBC drivers. DSN-less connections conversely are less secure than DSN connections because the path to your database is located in your code and if you code wrong like using .inc for include file extensions than everyone can see where you database is.

    A DSN-less connection looks like (this is a modified connection string from my site):
    <BLOCKQUOTE><font size="1" face="Verdana, Arial">code/font><HR><pre>
    Const manageDSN =
    "DBQ=D:\path\to\your\database.mdb;Driver={Microsoft Access Driver (*.mdb)};DriverId=25;" &_
    "FIL=MS Access;ImplicitCommitSync=Yes;" &_
    "MaxBufferSize=512;MaxScanRows=8;PageTimeout=5;SafeTransactions=0;Threads=3;" &_
    "UID=admin;UserCommitSync=Yes;"
    [/code]

    A DSN connection looks like:
    <BLOCKQUOTE><font size="1" face="Verdana, Arial">code/font><HR><pre>
    Const manageDSN = "DSN=dsnname"
    [/code]

    The only real difference between the two is that the connection string for a DSN connection is stored in the registry of the webserver, whereas in a DSN-less connection it is stored in your ASP page.

    ------------------
    Wayne Luke - Sitepoint Moderator/Internet Media Developer
    Digital Magician Studios - Making Magic with Web Applications
    wluke@digitalmagician.com


    [This message has been edited by wluke (edited May 14, 2000).]


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •