Professional Web Applications Themes

Which db connection is better? DSN vs. straight - ASP Database

> hard code the connection into your code calling the servername and database > name directly (whether you place it in an include or in the Web.config file) > or you can call a DSN where the only thing you have to do is give it the DSN > name (you can add db name, username and password if you need to). The DSN > connection then relies on the ODBC connector you created earlier. ODBC is deprecated. Use OLEDB / DSN-less whenever possible. [url]http://www.aspfaq.com/2126[/url] -- [url]http://www.aspfaq.com/[/url] (Reverse address to reply.)...

  1. #1

    Default Re: Which db connection is better? DSN vs. straight

    > hard code the connection into your code calling the servername and
    database
    > name directly (whether you place it in an include or in the Web.config
    file)
    > or you can call a DSN where the only thing you have to do is give it the
    DSN
    > name (you can add db name, username and password if you need to). The DSN
    > connection then relies on the ODBC connector you created earlier.
    ODBC is deprecated. Use OLEDB / DSN-less whenever possible.
    [url]http://www.aspfaq.com/2126[/url]

    --
    [url]http://www.aspfaq.com/[/url]
    (Reverse address to reply.)


    Aaron [SQL Server MVP] Guest

  2. #2

    Default Re: Which db connection is better? DSN vs. straight

    Interesting, but all I am seeing is "management issues" if you don't own the
    server. I do. If you have connections to multiple dbs then you must have
    multiple datasource files (includes), which require you to make a change in
    your actual code, when migrating from dev. to staging to production.
    Everytime you make this migration for a new/updated complete site or
    new/updated section you have to go into the code and change it. As opposed
    to setting the dsn up once, with the same name across all servers.

    What about security. Having the DSNless connection string carrying the
    connection info such as username and password is dangerous as well. But of
    course DSN connections have their security concerns too.

    ODBC is deprecated? Meaning what exactly? MS doesn't recommend it anymore?

    I would like to hear a little more "reasons" behind each for justification
    of choice.

    More discussion?

    Brian



    "Aaron [SQL Server MVP]" wrote:
    > > hard code the connection into your code calling the servername and
    > database
    > > name directly (whether you place it in an include or in the Web.config
    > file)
    > > or you can call a DSN where the only thing you have to do is give it the
    > DSN
    > > name (you can add db name, username and password if you need to). The DSN
    > > connection then relies on the ODBC connector you created earlier.
    >
    > ODBC is deprecated. Use OLEDB / DSN-less whenever possible.
    > [url]http://www.aspfaq.com/2126[/url]
    >
    > --
    > [url]http://www.aspfaq.com/[/url]
    > (Reverse address to reply.)
    >
    >
    >
    cheezebeetle Guest

  3. #3

    Default Re: Which db connection is better? DSN vs. straight

    cheezebeetle wrote:
    >
    > ODBC is deprecated? Meaning what exactly? MS doesn't recommend it
    > anymore?
    >
    > I would like to hear a little more "reasons" behind each for
    > justification
    > of choice.
    >
    You failed to follow this link in the article:
    [url]http://msdn.microsoft.com/library/default.asp?url=/library/en-us/ado270/htm/ado_deprecated_components.asp[/url]

    --
    Microsoft MVP -- ASP/ASP.NET
    Please reply to the newsgroup. The email account listed in my From
    header is my spam trap, so I don't check it very often. You will get a
    quicker response by posting to the newsgroup.


    Bob Barrows [MVP] Guest

  4. #4

    Default Re: Which db connection is better? DSN vs. straight

    Don't forget that ODBC uses more processor time then native jet drivers.

    So stop using it. You will see an improvement in the speed of you
    database applications when you do.

    cheezebeetle wrote:
    > Interesting, but all I am seeing is "management issues" if you don't own the
    > server. I do. If you have connections to multiple dbs then you must have
    > multiple datasource files (includes), which require you to make a change in
    > your actual code, when migrating from dev. to staging to production.
    > Everytime you make this migration for a new/updated complete site or
    > new/updated section you have to go into the code and change it. As opposed
    > to setting the dsn up once, with the same name across all servers.
    >
    > What about security. Having the DSNless connection string carrying the
    > connection info such as username and password is dangerous as well. But of
    > course DSN connections have their security concerns too.
    >
    > ODBC is deprecated? Meaning what exactly? MS doesn't recommend it anymore?
    >
    > I would like to hear a little more "reasons" behind each for justification
    > of choice.
    >
    > More discussion?
    >
    > Brian
    >
    >
    >
    > "Aaron [SQL Server MVP]" wrote:
    >
    >
    >>>hard code the connection into your code calling the servername and
    >>
    >>database
    >>
    >>>name directly (whether you place it in an include or in the Web.config
    >>
    >>file)
    >>
    >>>or you can call a DSN where the only thing you have to do is give it the
    >>
    >>DSN
    >>
    >>>name (you can add db name, username and password if you need to). The DSN
    >>>connection then relies on the ODBC connector you created earlier.
    >>
    >>ODBC is deprecated. Use OLEDB / DSN-less whenever possible.
    >>[url]http://www.aspfaq.com/2126[/url]
    >>
    >>--
    >>[url]http://www.aspfaq.com/[/url]
    >>(Reverse address to reply.)
    >>
    >>
    >>
    joker Guest

Similar Threads

  1. Straight connectors?
    By Christian Zenner in forum Macromedia Freehand
    Replies: 8
    Last Post: October 19th, 07:52 PM
  2. Rotation but keep going straight???
    By Nicollini webforumsuser@macromedia.com in forum Macromedia Director 3D
    Replies: 2
    Last Post: September 2nd, 02:28 PM
  3. what exactly do you need to escape? (I can never get this straight)
    By Steve Grazzini in forum PERL Miscellaneous
    Replies: 2
    Last Post: July 16th, 11:46 PM

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
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139