DB Connection :: Global.use vs .Inc file?

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

  1. #1

    Default DB Connection :: Global.use vs .Inc file?

    I am adapting a login script to suite my specific purposes by require
    guideance on best practice with regards the following:

    Should I be initiating the database connection in the global.asa or via the
    existing database include file I have at the moment....

    My current database utitliy include allows my to grab the file but I am
    wondering if it makes sense to dispense with this segment of the code and
    place
    it in the global.aso....See below


    function GetConnection()
    const DSN = "V032U10DUW"
    const UID = "V032U10DUW"
    const PASSWORD = "cU3QmtgDyzWX"



    Dim p_oConn, sDSN
    Set p_oConn = server.createObject("ADODB.Connection")
    '//sDSN = "DSN=" & DSN & ";uid=" & UID & ";password=" & PASSWORD
    '//sDSN.open = "driver={SQL
    Server};server=MAXSQL00?.maximumasp.com;DB=yourSQL DBName;UID=yourSQLLogin;PW
    D=YourSQLPassword"
    p_oConn.open "driver={SQL
    Server};server=MAXSQL008.maximumasp.com;DB=V032U10 DUW;UID=V032U10DUW;PWD=cU3
    QmtgDyzWX"
    Set GetConnection = p_oConn
    end function

    function GetStoredProcedure(oConnection, sName)
    Dim oCmd
    Set oCmd = Server.createobject("ADODB.Command")
    Set oCmd.ActiveConnection = oConn
    oCmd.CommandText = sName
    oCmd.CommandType = adCmdStoredProc
    Set GetStoredProcedure = oCmd
    end function



    Guest

  2. Similar Questions and Discussions

    1. global security - with NO internet connection?
      just upgraded my machine that has no internet connection to flash 8- I double clicked on my tried and true .swf file, developed in 7.2 - and it...
    2. global.asa file
      I want to use a query to active directory that holds a user name, group role and group region and stores those values as session variables in the...
    3. Can I open a database connection in my GLOBAL.ASA file?
      Can I use my GLOBAL.ASA file to open a database connection before each page loads? Would someone mind posting a very simple example? I tried to...
    4. Question about Global.asa file
      Terry Murray wrote on 09 aug 2003 in microsoft.public.inetserver.asp.db: No -- Evertjan. The Netherlands. (Please change the x'es to dots in...
    5. Is it bad to have a large GLOBAL.ASA file?
      It seems to me that I generally use two types of Functions: Type #1-Ones that any page on my site might use Type #2-Ones that only a single page...
  3. #2

    Default Re: DB Connection :: Global.use vs .Inc file?

    [email]jason@catamaranco.com[/email] wrote:
    > I am adapting a login script to suite my specific purposes by require
    > guideance on best practice with regards the following:
    >
    > Should I be initiating the database connection in the global.asa or
    > via the existing database include file I have at the moment....
    >
    > My current database utitliy include allows my to grab the file but I
    > am wondering if it makes sense to dispense with this segment of the
    > code and place
    > it in the global.aso....See below
    [url]http://www.aspfaq.com/show.asp?id=2053[/url]

    Bob Barrows
    --
    Microsoft MVP - ASP/ASP.NET
    Please reply to the newsgroup. This email account is my spam trap so I
    don't check it very often. If you must reply off-line, then remove the
    "NO SPAM"


    Bob Barrows [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