Ask a Question related to ASP Database, Design and Development.
-
Paul Close #1
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
-
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.... -
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 -... -
slow global.asa execution
Server specs? * * * Sent via DevBuilder http://www.devbuilder.org * * * Developer Resources for High End Developers. -
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 -
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... -
Paul Close #2
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
-
Phillip Windell #3
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...page but> Hi Everyone,
>
> The following code runs in less than one second when used in an ASPnew> when used in Session_onStart() in global.asa, the first page in awork - its> session is delayed by more than thirty seconds. The code seems to"','" &> 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
-
Phillip Windell #4
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...page but> Hi Everyone,
>
> The following code runs in less than one second when used in an ASPnew> when used in Session_onStart() in global.asa, the first page in awork - its> session is delayed by more than thirty seconds. The code seems to"','" &> 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
-
Phillip Windell #5
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...page but> Hi Everyone,
>
> The following code runs in less than one second when used in an ASPnew> when used in Session_onStart() in global.asa, the first page in awork - its> session is delayed by more than thirty seconds. The code seems to"','" &> 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
-
Phillip Windell #6
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...page but> Hi Everyone,
>
> The following code runs in less than one second when used in an ASPnew> when used in Session_onStart() in global.asa, the first page in awork - its> session is delayed by more than thirty seconds. The code seems to"','" &> 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
-
Arnold Shore #7
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...> page but> > Hi Everyone,
> >
> > The following code runs in less than one second when used in an ASP> new> > when used in Session_onStart() in global.asa, the first page in a> work - its> > session is delayed by more than thirty seconds. The code seems to> "','" &> > 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
-
Arnold Shore #8
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...> page but> > Hi Everyone,
> >
> > The following code runs in less than one second when used in an ASP> new> > when used in Session_onStart() in global.asa, the first page in a> work - its> > session is delayed by more than thirty seconds. The code seems to> "','" &> > 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
-
Phillip Windell #9
Re: Slow MDB acess in global.asa
"Arnold Shore" <ashore@saefern.org> wrote in message
news:e1Nza$shDHA.2420@TK2MSFTNGP10.phx.gbl...does it> Good advice, I guess; I've been fighting that symptom. But whereIt's the "proverbial it", kinda like the "proverbial they".> say that "You're supposed to do it in the ASP file that needs it"
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
-
Phillip Windell #10
Re: Slow MDB acess in global.asa
"Arnold Shore" <ashore@saefern.org> wrote in message
news:e1Nza$shDHA.2420@TK2MSFTNGP10.phx.gbl...does it> Good advice, I guess; I've been fighting that symptom. But whereIt's the "proverbial it", kinda like the "proverbial they".> say that "You're supposed to do it in the ASP file that needs it"
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



Reply With Quote

