global.asa and security

Results 1 to 3 of 3

Thread: global.asa and security

  1. #1
    Join Date
    Dec 1969

    Default global.asa and security

    I got away from this to work on soemthing else but now I&#039m back at it.<BR><BR>I have a pasword protected wb site that uses an access db and an includes file to check for the users login. The code is below. My problem is that all works fine in the root but when I go below the root and include the "check page" the db conection can&#039t be found. I know why but I don&#039t know how to resolve the issue. Someone suggested putting the path in a global.asa file. I&#039ve never used one before and haven&#039t the slightest idea how to go about it. The includes file is below; any help would be appreciated. If you have another idea I&#039m open to that too. Thanks<BR><BR>dim conn<BR>dim strconn<BR><BR>strconn = "DRIVER=Microsoft Access Driver (*.mdb);DBQ=" & Server.MapPath("arth/tls.mdb")<BR><BR>set conn = server.createobject("adodb.connection")<BR>conn.op en strconn<BR><BR>Username = Request("Username")<BR>Password = Request("Password")<BR><BR>SQL = "SELECT * FROM Table1 WHERE UserName = &#039" & Username & "&#039 AND Password =&#039" & Password & "&#039"<BR>set oRs = conn.Execute(SQL)<BR>If oRs.EOF Then<BR>Response.Redirect("sorry.asp")<BR>Else<BR> Session("id") = oRs("ID")<BR>End If<BR>Set conn = Nothing

  2. #2

    Default RE: global.asa and security

    Hi,<BR><BR>In Application_OnStart in Global.asa, use an <BR>Application("DBConnect") variable to store your connection String to the Access Database. This will cache in Web Server memory, and can be called by Apllication variable name in anu of the nested folders of the Root !<BR><BR>IQ

  3. #3
    Join Date
    Dec 1969

    Default Thanks but.....

    Thanks!<BR><BR>I don&#039t know any syntax at all for a global.asa could you provide an example?

Posting Permissions

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