473,837 Members | 1,771 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

ASP Compiling?

I've got a website that is very fast. I just added a subroutine in the file global.asp
(global.asp is run each time any page is called). The subroutine determines the user's
country by comparing their IP address against a 6Meg Access database that converts IP to
country. It then sets a Session variable with the user's country.

After that, each time the subroutine is called it checks to see if that Session variable
is set. If it is, it exits the subroutine - without calling the Access database.

Regardless, I've noticed that my website is slightly slower than before.

Even though the Access database is only called once per session, does ASP compile
global.asp each time it is run, and is it slowing down because it is
compiling/establishing/whatever a connection to the Access database that it is not using
anyway?

(Hey, I know MS SQL is faster than Access! I'm trying to understand more about ASP,
that's all)

Thanks!

Vic

Aug 30 '06 #1
7 2345
Victor wrote:
I've got a website that is very fast. I just added a subroutine in
the file global.asp (global.asp is run each time any page is called).
Not really. Global.asp contains code for certain events:
application_ons tart, application_one nd, session_onstart and session_onend.
Where did you put your initialization code?
The subroutine determines the user's country by comparing their IP
address against a 6Meg Access database that converts IP to country.
It then sets a Session variable with the user's country.
So you used Session_onstart ?
>
After that, each time the subroutine
Where is this subroutine located? in a ssi file?
is called it checks to see if
that Session variable is set. If it is, it exits the subroutine -
without calling the Access database.

Regardless, I've noticed that my website is slightly slower than
before.

Even though the Access database is only called once per session, does
ASP compile global.asp each time it is run, and is it slowing down
because it is compiling/establishing/whatever a connection to the
Access database that it is not using anyway?
Probably not, unless you've made the mistake of storing an ADO object in
Session or Application
--
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"
Aug 31 '06 #2

Bob Barrows [MVP] wrote:
Victor wrote:
I've got a website that is very fast. I just added a subroutine in
the file global.asp (global.asp is run each time any page is called).

Not really. Global.asp contains code for certain events:
application_ons tart, application_one nd, session_onstart and session_onend.
Global.asp or Global.asa?

--
Mike Brind

Aug 31 '06 #3
Mike Brind wrote:
Bob Barrows [MVP] wrote:
>Victor wrote:
>>I've got a website that is very fast. I just added a subroutine in
the file global.asp (global.asp is run each time any page is
called).

Not really. Global.asp contains code for certain events:
application_on start, application_one nd, session_onstart and
session_onen d.

Global.asp or Global.asa?
Oops. I kept mentally changing that to asa.

Victor, are you talking about an include file called Global.asp?

Show us the code so we can intelligently answer your question.
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
Aug 31 '06 #4

"Bob Barrows [MVP]" <re******@NOyah oo.SPAMcomwrote in message
news:uj******** ******@TK2MSFTN GP05.phx.gbl...
Victor wrote:
I've got a website that is very fast. I just added a subroutine in
the file global.asp (global.asp is run each time any page is called).

Not really. Global.asp contains code for certain events:
application_ons tart, application_one nd, session_onstart and session_onend.
Where did you put your initialization code?
No, you are describing global.ASA.

Global.ASP is MY code.

Aug 31 '06 #5

"Bob Barrows [MVP]" <re******@NOyah oo.SPAMcomwrote in message
news:ej******** ********@TK2MSF TNGP02.phx.gbl. ..
Mike Brind wrote:
Bob Barrows [MVP] wrote:
Victor wrote:
I've got a website that is very fast. I just added a subroutine in
the file global.asp (global.asp is run each time any page is
called).

Not really. Global.asp contains code for certain events:
application_ons tart, application_one nd, session_onstart and
session_onend.
Global.asp or Global.asa?

Oops. I kept mentally changing that to asa.

Victor, are you talking about an include file called Global.asp?

Show us the code so we can intelligently answer your question.
"global.asp ".

Let me put it another way - when a .ASP page is called, I understand that the entire
page is compiled even if a subroutine or function or piece of code isn't used.

So, when an ASP page is COMPILED (NOT run), are database connections verified or
established even if it's not called?

For example, if I had this code:

If 1=2 Then ' ### This will never be called.becauae 1 <2.
' ### Connect to Access Database - this will never be called
strAccessDB = "/database/my6MegAccessDat abase.mdb"
accessdb = server.mappath( strAccessDB)
strconn = "PROVIDER=Micro soft.Jet.OLEDB. 4.0;DATA SOURCE=" & accessDB & ";"
Set conn = Server.CreateOb ject("ADODB.Con nection")
conn.open strconn
End If

Even though the above routine is never called, will it still be compiled, and a database
connection established, when the page it is on is called?

I suspect - and I'm looking for verification/documentation of this - that database
connections are established/verified at COMPILE time (NOT runtime). If that's the case I
may use a Server.Execute to only compile the code when needed.


Aug 31 '06 #6
Victor wrote:
Let me put it another way - when a .ASP page is called, I understand
that the entire page is compiled even if a subroutine or function or
piece of code isn't used.
True
So, when an ASP page is COMPILED (NOT run), are database connections
verified or established even if it's not called?
No
>
For example, if I had this code:

If 1=2 Then ' ### This will never be called.becauae 1 <2.
' ### Connect to Access Database - this will never be called
strAccessDB = "/database/my6MegAccessDat abase.mdb"
accessdb = server.mappath( strAccessDB)
strconn = "PROVIDER=Micro soft.Jet.OLEDB. 4.0;DATA SOURCE=" &
accessDB & ";" Set conn = Server.CreateOb ject("ADODB.Con nection")
conn.open strconn
End If

Even though the above routine is never called, will it still be
compiled,
Yes
and a database connection established, when the page it is
on is called?
No. Compiling does not involve executing the code. Compiling just
translates it to machine-executable code. Think about why database
connection problems are only caught at runtime: never at compile time.
For example: supply a non-existant database in your connection string:
that will not be caught at compile time will it? Use your above if
statement to verify this.
>
I suspect - and I'm looking for verification/documentation of this -
that database connections are established/verified at COMPILE time
(NOT runtime).
No. Code is only executed at runtime (which is why it is called
"runtime").
If that's the case I may use a Server.Execute to only
compile the code when needed.
Depending on what the code is, that may be what you want to do anyways.

--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
Aug 31 '06 #7
"Bob Barrows [MVP]" wrote...
Victor wrote:
:
and a database connection established, when the page it is
on is called?

No. Compiling does not involve executing the code. Compiling just
translates it to machine-executable code. Think about why database
connection problems are only caught at runtime: never at compile time.
For example: supply a non-existant database in your connection string:
that will not be caught at compile time will it? Use your above if
statement to verify this.
O.K., thanks Bob, this is exactly the info I was looking for!

Vic

Aug 31 '06 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
2080
by: Martin Bless | last post by:
I need to access a MSSQL database (MS-Sql, not MySQL!)and would very much like to use mssql-0.09.tar.gz which is available from http://www.object-craft.com.au/projects/mssql/download.html Unfortunately the binary for Python-2.4 isn't available yet and I'd hate to step back to a previous version. I'm glad I managed to set up my XP machine to being able to compile extensions using the VC++ toolkit which freely availbale from MS. See
3
3661
by: modemer | last post by:
Hello, I got weird compiling message similar like following when I compiled my simple code on Sun 5.8 with CC WorkShop 6 update 2 C++ 5.3. CC -g -o myclass.o -c myclass.cpp CC -g -o main.o -c main.cpp CC -g -L/usr/lib -lsocket -lnsl -o main myclass.o main.o __1cH__rwstdJ__rb_tree4CpknJmyclassHCSOCKET_nDstdEpair4Ck4n0BNCSOCKEVENTMGRJ SOCKEVENT___n0AL__select1st4n0G_C4__n0DEless4C4__n0DJallocator4n0G____Efind6
0
3073
by: David W. Fenton | last post by:
Today I was working on a hideous old app that I created a long time ago that does a lot of showing/hiding/resizing of fields on one of the forms. I had used constants to store reference values for many of the top/height/left settings. I noticed that some of the constants were defined by using other constant values, and I was impressed that VBA could do that. Here's an example: Const row1Top = 1.0208 * 1440 ' top of first row Const...
4
11368
by: Aaron Queenan | last post by:
When I build a C++ library to .NET using the managed C++ compiler, I get the following error message: Linking... LINK : error LNK2020: unresolved token (0A000005) _CrtDbgReport LINK : error LNK2020: unresolved token (0A000007) memset LINK : error LNK2020: unresolved token (0A000008) free LINK : error LNK2020: unresolved token (0A00000A) atexit LINK : error LNK2020: unresolved token (0A000028) wcscpy LINK : error LNK2020: unresolved...
2
1875
by: Rudy Ray Moore | last post by:
Hi guys, I just upgraded to "Visual Studio .net 2003 7.1 c++" from VS6. Some things I like (proper for loop variable scoping, for example), but some other things are troubling me. One annoying behavior is that the text editor often "hangs" (doesn't let me type) while compiling. Is there a way to fix this so it behaves more like VS6 (editor does not hang while compiling)?
1
1913
by: Jim Heavey | last post by:
Hello, trying to round out my knowlege here about compiling. To date I have used VS.Net to do all my compiling "majically", but I want to understand how to do it on my own, should the need ever arrise. It has been suggested to me that I should use the following pattern when compiling my programs, but I am not sure I understand the "pattern", Try creating a text file along the following lines where the /r are the dlls you are...
10
2208
by: Christina N | last post by:
When compiling my ASP.Net application, VS puts the new DLL under the local cached directory 'VSWebCache' in stead of on the server. How can I make it save the DLL file on the server when compiling? I have opened the source code project through 'File - Open - Open project from web..' Best regards, Christina
2
1963
by: Justin Naidl | last post by:
A group of friends and I are doing a RPG (role-playing game) maker for a school project. It occured to us, however, that if you want the user to be able to have almost complete control over the contents of his/her game, that you would end up with a tiny executable and a huge datafile. We wanted to keep clear of this as disk accesses take a lot of time to do and there would be a huge load of them to do this part. We could very easily...
8
2212
by: WebSnozz | last post by:
I have an application written in C that does a lot of low level stuff. It does a lot of things like casting from void*'s. I want to create a new GUI for it in either C# or MC++, but reuse the existing code. The options I've considered so far: 1. Create a new MC++ GUI project and add the *.c files to them and mark them with pragma unamanged. However, the /clr option does not compile *.c files, so I rename them to *.cpp, and now they...
0
1396
by: =?Utf-8?B?amVmZmVyeQ==?= | last post by:
i need help compiling code dynamically it may involve some reflection so if any one is any good in that field or compiling code this would be a great time to show me what you know. by the way my last weird but serious combo box error i solved my self it was just a simple recompile and some simple code changes and it worked. i will put a link to the code for compiling dynamially here: <a href =...
0
9846
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9693
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10897
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10583
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9419
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
7009
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4481
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4056
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3128
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.