Best connection string to connect to SQL dbase...

Ask a Question related to ASP Database, Design and Development.

  1. #1

    Default Best connection string to connect to SQL dbase...

    I need to connect to a dbase. I will be using ASP.NET, Windows 2003 Server,
    and SQL 2000. What would the best connection method be:

    OLE DB :
    <%
    Set cnn = Server.CreateObject("ADODB.Connection")
    cnn.open "PROVIDER=SQLOLEDB;DATA
    SOURCE=sqlservername;UID=username;PWD=password;DAT ABASE=mydatabase "
    %>

    With DSN :
    <%
    Set Conn = Server.CreateObject("ADODB.Connection")
    Conn.open "DSN=MyDSN;UID=user;PWD=password;DATABASE=mydataba se"
    %>

    Without DSN :
    <%
    Set Conn = Server.CreateObject("ADODB.Connection")
    DSNtest="DRIVER={SQL
    Server};SERVER=ServerName;UID=USER;PWD=password;DA TABASE=mydatabase"
    Conn.open DSNtest
    %>

    I go these off of MS web site. (Or would there be a beter way?)

    Thanks,

    M



    Mike Hill Guest

  2. Similar Questions and Discussions

    1. Connect to Oracle DB using Connection String
      :confused; Please help me out here. I want to connect to Oracle 9i / 10g database using connection string defined in the application.cfm to create...
    2. What is the most efficient way to connect to a MySQL dbase?
      I am setting up a data driven site and I will be using MySQL. What is the best connection method to use. (ADO, etc..) It will be hosed on a W2K...
    3. Access dbase connection string errors
      I keep getting "Unable to open registry key 'Temporary (volatile) Jet DSN " errors pointing to my connection string when the same connection string...
    4. Connection String to connect to SQL Server Database
      http://www.able-consulting.com/ADO_Conn.htm Brian Staff
    5. #14562 [Asn->Csd]: dBase: Unable to obtain dBase file structure
      ID: 14562 Updated by: zak@php.net Reported By: tom dot polak at post dot sk -Status: Assigned +Status: ...
  3. #2

    Default Re: Best connection string to connect to SQL dbase...

    [url]http://www.aspfaq.com/show.asp?id=2126[/url]

    Chris


    CJM Guest

  4. #3

    Default Re: Best connection string to connect to SQL dbase...

    OLEDB (the first one). However, please post further asp.net questions to an
    asp.net newsgroup.

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




    "Mike Hill" <mhill7272(at)hotmail.com> wrote in message
    news:uLcIbfjTEHA.808@tk2msftngp13.phx.gbl...
    > I need to connect to a dbase. I will be using ASP.NET, Windows 2003
    Server,
    > and SQL 2000. What would the best connection method be:
    >
    > OLE DB :
    > <%
    > Set cnn = Server.CreateObject("ADODB.Connection")
    > cnn.open "PROVIDER=SQLOLEDB;DATA
    > SOURCE=sqlservername;UID=username;PWD=password;DAT ABASE=mydatabase "
    > %>
    >
    > With DSN :
    > <%
    > Set Conn = Server.CreateObject("ADODB.Connection")
    > Conn.open "DSN=MyDSN;UID=user;PWD=password;DATABASE=mydataba se"
    > %>
    >
    > Without DSN :
    > <%
    > Set Conn = Server.CreateObject("ADODB.Connection")
    > DSNtest="DRIVER={SQL
    > Server};SERVER=ServerName;UID=USER;PWD=password;DA TABASE=mydatabase"
    > Conn.open DSNtest
    > %>
    >
    > I go these off of MS web site. (Or would there be a beter way?)
    >
    > Thanks,
    >
    > M
    >
    >
    >

    Aaron [SQL Server MVP] Guest

Posting Permissions

  • You may not post new threads
  • You may 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