Slow MDB acess in global.asa

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

  1. #1

    Default Slow MDB acess in global.asa

    Hi Everyone,

    The following code runs in less than one second when used in an ASP page but
    when used in Session_onStart() in global.asa, the first page in a new
    session is delayed by more than thirty seconds. The code seems to work - its
    just slooow. Why is this so and how do I fix it?

    Dim cnComDoc
    Set cnComDoc = Server.CreateObject("ADODB.Connection")
    cnComDoc.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data
    Source=c:\comdoc.mdb;Persist Security Info=False"
    cnComDoc.execute "Insert into SessionInfo
    (SessionID,BeginDateTime,IPAddress) values ('" & Session.SessionID & "','" &
    FormatDateTime(now(), vbGeneralDate) & "','" &
    Request.ServerVariables("REMOTE_ADDR") & "')",,adCmdText +
    adExecuteNoRecords
    Set cnComDoc = Nothing


    Paul Close Guest

  2. Similar Questions and Discussions

    1. MS-Acess
      I have an access db running on an old websever and would like to create a datasourse on the new webserver until I setup the access db into MS-SQL....
    2. IIS/Acess DB problem.
      I get this error trying to open a access database thru ODBC when accessing a web page using IIS. The error is as follows: HTTP 500.100 -...
    3. slow global.asa execution
      Server specs? * * * Sent via DevBuilder http://www.devbuilder.org * * * Developer Resources for High End Developers.
    4. acess denied for my documents help Please !
      Hello My PC froze during upgrade to SP1 and now i cant access my documents of windows xp pro after installing it again. Please help thank you
    5. Problem with acess to cmd.exe
      Márcio wrote: Are you in a domain? -- -the small one All postings carry no guarantee or warranty, expressed or implied. Proceed at your...
  3. #2

    Default Slow MDB acess in global.asa

    Hi Everyone,

    The following code runs in less than one second when used in an ASP page but
    when used in Session_onStart() in global.asa, the first page in a new
    session is delayed by more than thirty seconds. The code seems to work - its
    just slooow. Why is this so and how do I fix it?

    Dim cnComDoc
    Set cnComDoc = Server.CreateObject("ADODB.Connection")
    cnComDoc.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data
    Source=c:\comdoc.mdb;Persist Security Info=False"
    cnComDoc.execute "Insert into SessionInfo
    (SessionID,BeginDateTime,IPAddress) values ('" & Session.SessionID & "','" &
    FormatDateTime(now(), vbGeneralDate) & "','" &
    Request.ServerVariables("REMOTE_ADDR") & "')",,adCmdText +
    adExecuteNoRecords
    Set cnComDoc = Nothing


    Paul Close Guest

  4. #3

    Default Re: Slow MDB acess in global.asa

    You fix it by not doing it in the Global.asa file. You're supposed to
    do it in the ASP file that needs it (use an Include file).


    --

    Phillip Windell [CCNA, MVP, MCP]
    [email]pwindell@wandtv.com[/email]
    WAND-TV (ABC Affiliate)
    [url]www.wandtv.com[/url]

    "Paul Close" <support@computerdoctor.com.au> wrote in message
    news:eEih4KhhDHA.2436@tk2msftngp13.phx.gbl...
    > Hi Everyone,
    >
    > The following code runs in less than one second when used in an ASP
    page but
    > when used in Session_onStart() in global.asa, the first page in a
    new
    > session is delayed by more than thirty seconds. The code seems to
    work - its
    > just slooow. Why is this so and how do I fix it?
    >
    > Dim cnComDoc
    > Set cnComDoc = Server.CreateObject("ADODB.Connection")
    > cnComDoc.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data
    > Source=c:\comdoc.mdb;Persist Security Info=False"
    > cnComDoc.execute "Insert into SessionInfo
    > (SessionID,BeginDateTime,IPAddress) values ('" & Session.SessionID &
    "','" &
    > FormatDateTime(now(), vbGeneralDate) & "','" &
    > Request.ServerVariables("REMOTE_ADDR") & "')",,adCmdText +
    > adExecuteNoRecords
    > Set cnComDoc = Nothing
    >
    >

    Phillip Windell Guest

  5. #4

    Default Re: Slow MDB acess in global.asa

    You fix it by not doing it in the Global.asa file. You're supposed to
    do it in the ASP file that needs it (use an Include file).


    --

    Phillip Windell [CCNA, MVP, MCP]
    [email]pwindell@wandtv.com[/email]
    WAND-TV (ABC Affiliate)
    [url]www.wandtv.com[/url]

    "Paul Close" <support@computerdoctor.com.au> wrote in message
    news:eEih4KhhDHA.2436@tk2msftngp13.phx.gbl...
    > Hi Everyone,
    >
    > The following code runs in less than one second when used in an ASP
    page but
    > when used in Session_onStart() in global.asa, the first page in a
    new
    > session is delayed by more than thirty seconds. The code seems to
    work - its
    > just slooow. Why is this so and how do I fix it?
    >
    > Dim cnComDoc
    > Set cnComDoc = Server.CreateObject("ADODB.Connection")
    > cnComDoc.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data
    > Source=c:\comdoc.mdb;Persist Security Info=False"
    > cnComDoc.execute "Insert into SessionInfo
    > (SessionID,BeginDateTime,IPAddress) values ('" & Session.SessionID &
    "','" &
    > FormatDateTime(now(), vbGeneralDate) & "','" &
    > Request.ServerVariables("REMOTE_ADDR") & "')",,adCmdText +
    > adExecuteNoRecords
    > Set cnComDoc = Nothing
    >
    >

    Phillip Windell Guest

  6. #5

    Default Re: Slow MDB acess in global.asa

    Sorry, I should have added more. Yes the Global.asa would seem to be
    the logical place to do this, but from what I've seen it doesn't
    always work that well. I assume you are wanting to track a user to see
    how long they were there or estimate when they left the site.
    If you're wanting to store the Session ID, then you'd want to make
    sure that the Session ID doesn't already exist before adding the
    record so it doesn't add a duplicate record each time they move to
    another page. You probably would want some kind of timestamp that is
    updated with each page they go to and then if the timestamp becomes
    older than the site's Session Timeout then either delete the record or
    do some other action based on that.

    --

    Phillip Windell [CCNA, MVP, MCP]
    [email]pwindell@wandtv.com[/email]
    WAND-TV (ABC Affiliate)
    [url]www.wandtv.com[/url]

    "Paul Close" <support@computerdoctor.com.au> wrote in message
    news:eEih4KhhDHA.2436@tk2msftngp13.phx.gbl...
    > Hi Everyone,
    >
    > The following code runs in less than one second when used in an ASP
    page but
    > when used in Session_onStart() in global.asa, the first page in a
    new
    > session is delayed by more than thirty seconds. The code seems to
    work - its
    > just slooow. Why is this so and how do I fix it?
    >
    > Dim cnComDoc
    > Set cnComDoc = Server.CreateObject("ADODB.Connection")
    > cnComDoc.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data
    > Source=c:\comdoc.mdb;Persist Security Info=False"
    > cnComDoc.execute "Insert into SessionInfo
    > (SessionID,BeginDateTime,IPAddress) values ('" & Session.SessionID &
    "','" &
    > FormatDateTime(now(), vbGeneralDate) & "','" &
    > Request.ServerVariables("REMOTE_ADDR") & "')",,adCmdText +
    > adExecuteNoRecords
    > Set cnComDoc = Nothing
    >
    >

    Phillip Windell Guest

  7. #6

    Default Re: Slow MDB acess in global.asa

    Sorry, I should have added more. Yes the Global.asa would seem to be
    the logical place to do this, but from what I've seen it doesn't
    always work that well. I assume you are wanting to track a user to see
    how long they were there or estimate when they left the site.
    If you're wanting to store the Session ID, then you'd want to make
    sure that the Session ID doesn't already exist before adding the
    record so it doesn't add a duplicate record each time they move to
    another page. You probably would want some kind of timestamp that is
    updated with each page they go to and then if the timestamp becomes
    older than the site's Session Timeout then either delete the record or
    do some other action based on that.

    --

    Phillip Windell [CCNA, MVP, MCP]
    [email]pwindell@wandtv.com[/email]
    WAND-TV (ABC Affiliate)
    [url]www.wandtv.com[/url]

    "Paul Close" <support@computerdoctor.com.au> wrote in message
    news:eEih4KhhDHA.2436@tk2msftngp13.phx.gbl...
    > Hi Everyone,
    >
    > The following code runs in less than one second when used in an ASP
    page but
    > when used in Session_onStart() in global.asa, the first page in a
    new
    > session is delayed by more than thirty seconds. The code seems to
    work - its
    > just slooow. Why is this so and how do I fix it?
    >
    > Dim cnComDoc
    > Set cnComDoc = Server.CreateObject("ADODB.Connection")
    > cnComDoc.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data
    > Source=c:\comdoc.mdb;Persist Security Info=False"
    > cnComDoc.execute "Insert into SessionInfo
    > (SessionID,BeginDateTime,IPAddress) values ('" & Session.SessionID &
    "','" &
    > FormatDateTime(now(), vbGeneralDate) & "','" &
    > Request.ServerVariables("REMOTE_ADDR") & "')",,adCmdText +
    > adExecuteNoRecords
    > Set cnComDoc = Nothing
    >
    >

    Phillip Windell Guest

  8. #7

    Default Re: Slow MDB acess in global.asa

    Good advice, I guess; I've been fighting that symptom. But where does it
    say that "You're supposed to do it in the ASP file that needs it"

    AS

    "Phillip Windell" <pwindell{at}wandtv*d0t*com> wrote in message
    news:#8xmRAphDHA.2500@TK2MSFTNGP09.phx.gbl...
    > You fix it by not doing it in the Global.asa file. You're supposed to
    > do it in the ASP file that needs it (use an Include file).
    >
    >
    > --
    >
    > Phillip Windell [CCNA, MVP, MCP]
    > [email]pwindell@wandtv.com[/email]
    > WAND-TV (ABC Affiliate)
    > [url]www.wandtv.com[/url]
    >
    > "Paul Close" <support@computerdoctor.com.au> wrote in message
    > news:eEih4KhhDHA.2436@tk2msftngp13.phx.gbl...
    > > Hi Everyone,
    > >
    > > The following code runs in less than one second when used in an ASP
    > page but
    > > when used in Session_onStart() in global.asa, the first page in a
    > new
    > > session is delayed by more than thirty seconds. The code seems to
    > work - its
    > > just slooow. Why is this so and how do I fix it?
    > >
    > > Dim cnComDoc
    > > Set cnComDoc = Server.CreateObject("ADODB.Connection")
    > > cnComDoc.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data
    > > Source=c:\comdoc.mdb;Persist Security Info=False"
    > > cnComDoc.execute "Insert into SessionInfo
    > > (SessionID,BeginDateTime,IPAddress) values ('" & Session.SessionID &
    > "','" &
    > > FormatDateTime(now(), vbGeneralDate) & "','" &
    > > Request.ServerVariables("REMOTE_ADDR") & "')",,adCmdText +
    > > adExecuteNoRecords
    > > Set cnComDoc = Nothing
    > >
    > >
    >
    >

    Arnold Shore Guest

  9. #8

    Default Re: Slow MDB acess in global.asa

    Good advice, I guess; I've been fighting that symptom. But where does it
    say that "You're supposed to do it in the ASP file that needs it"

    AS

    "Phillip Windell" <pwindell{at}wandtv*d0t*com> wrote in message
    news:#8xmRAphDHA.2500@TK2MSFTNGP09.phx.gbl...
    > You fix it by not doing it in the Global.asa file. You're supposed to
    > do it in the ASP file that needs it (use an Include file).
    >
    >
    > --
    >
    > Phillip Windell [CCNA, MVP, MCP]
    > [email]pwindell@wandtv.com[/email]
    > WAND-TV (ABC Affiliate)
    > [url]www.wandtv.com[/url]
    >
    > "Paul Close" <support@computerdoctor.com.au> wrote in message
    > news:eEih4KhhDHA.2436@tk2msftngp13.phx.gbl...
    > > Hi Everyone,
    > >
    > > The following code runs in less than one second when used in an ASP
    > page but
    > > when used in Session_onStart() in global.asa, the first page in a
    > new
    > > session is delayed by more than thirty seconds. The code seems to
    > work - its
    > > just slooow. Why is this so and how do I fix it?
    > >
    > > Dim cnComDoc
    > > Set cnComDoc = Server.CreateObject("ADODB.Connection")
    > > cnComDoc.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data
    > > Source=c:\comdoc.mdb;Persist Security Info=False"
    > > cnComDoc.execute "Insert into SessionInfo
    > > (SessionID,BeginDateTime,IPAddress) values ('" & Session.SessionID &
    > "','" &
    > > FormatDateTime(now(), vbGeneralDate) & "','" &
    > > Request.ServerVariables("REMOTE_ADDR") & "')",,adCmdText +
    > > adExecuteNoRecords
    > > Set cnComDoc = Nothing
    > >
    > >
    >
    >

    Arnold Shore Guest

  10. #9

    Default Re: Slow MDB acess in global.asa

    "Arnold Shore" <ashore@saefern.org> wrote in message
    news:e1Nza$shDHA.2420@TK2MSFTNGP10.phx.gbl...
    > Good advice, I guess; I've been fighting that symptom. But where
    does it
    > say that "You're supposed to do it in the ASP file that needs it"
    It's the "proverbial it", kinda like the "proverbial they".

    It is just the normal principle of only creating what you need when
    you need it, then use it, then close or eliminate it as soon as your
    finished, rather than do it in the global.asa where it continues to
    exist throught the life of the Application.

    Plus using it in Include files means if a page doesn't require any
    database activity, then the particular Include file isn't used,
    therefore no resources are used for a database connection that you
    don't need. In other words,...treat each page as its own individual
    stand-alone program except for specific situations that require
    otherwise. That is the concept that HTTP is built on anyway.

    --

    Phillip Windell [CCNA, MVP, MCP]
    [email]pwindell@wandtv.com[/email]
    WAND-TV (ABC Affiliate)
    [url]www.wandtv.com[/url]


    Phillip Windell Guest

  11. #10

    Default Re: Slow MDB acess in global.asa

    "Arnold Shore" <ashore@saefern.org> wrote in message
    news:e1Nza$shDHA.2420@TK2MSFTNGP10.phx.gbl...
    > Good advice, I guess; I've been fighting that symptom. But where
    does it
    > say that "You're supposed to do it in the ASP file that needs it"
    It's the "proverbial it", kinda like the "proverbial they".

    It is just the normal principle of only creating what you need when
    you need it, then use it, then close or eliminate it as soon as your
    finished, rather than do it in the global.asa where it continues to
    exist throught the life of the Application.

    Plus using it in Include files means if a page doesn't require any
    database activity, then the particular Include file isn't used,
    therefore no resources are used for a database connection that you
    don't need. In other words,...treat each page as its own individual
    stand-alone program except for specific situations that require
    otherwise. That is the concept that HTTP is built on anyway.

    --

    Phillip Windell [CCNA, MVP, MCP]
    [email]pwindell@wandtv.com[/email]
    WAND-TV (ABC Affiliate)
    [url]www.wandtv.com[/url]


    Phillip Windell 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