473,785 Members | 2,924 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

ASP Include Problems

Hi there,

Got an include file causing a timeout on the server when it's called on...

The code has a loop in it that I suspect may be the cause...

I can forward the entire inc file should it be necessary...

Many thanks as ever..
Max
Maxh att zelhurst dott com

if (user_id = "") Then
loggedin=false
do
user_id=generat eID(5)
user_sql="SELEC T tbl_user.user_i d FROM
tbl_user WHERE ((tbl_user.user _id)=" & user_id & ");"
loop while db_validate(use r_id, user_sql)

user_sql= "INSERT INTO tbl_user (user_id,
username, lastipaddress, lastcompname, expires )VALUES "
user_sql= user_sql & "('" & user_id & "','" &
"','" & Request.ServerV ariables("REMOT E_ADDR") & "','" &
Request.ServerV ariables("REMOT E_USER") & "','" & user_expires &
"');"
conn.Execute(us er_sql)
end if

Jul 19 '05 #1
3 2087
<woeful-plea instyleof="Shak espearian Tragedy">
Doesn't anybody care about code readability, comments, case, error
handling, and variable declaration anymore?
</woeful-plea>

What is the function db_validate() that provides the loop exit point?

In order to debug you need to fix your code first by making judicious use
of:

Option Explicit
Dimension your variables
Place comments in the code to say what's going on.
Never have loops that don't have a 'get out' clause (eg. after 5 seconds
or 1000 loops etc.).
Include error traps to detect errors after SQL executions (implies use
of On Error Resume Next).

I'm not having a go at *you* but your post is symptomatic of a lot of very
short requests for help that are patently impossible to comment on without
the request for 'a short code section that is self-contained and
demonstrates the issue'.

To be honest, you seem to have found the issue already - examine your loop
response in debug mode and I'm sure you'll find the source of the problem.
At the very least put a get out clause in that allows you to report and
process the error (if it's an error that's occurring).

Regards,

Chris Barber.
"Max Hazelhurst" <ma**@zelhurst. com> wrote in message
news:BC4E97ED.A AA%ma**@zelhurs t.com...
Hi there,

Got an include file causing a timeout on the server when it's called on...

The code has a loop in it that I suspect may be the cause...

I can forward the entire inc file should it be necessary...

Many thanks as ever..
Max
Maxh att zelhurst dott com

if (user_id = "") Then
loggedin=false
do
user_id=generat eID(5)
user_sql="SELEC T tbl_user.user_i d FROM
tbl_user WHERE ((tbl_user.user _id)=" & user_id & ");"
loop while db_validate(use r_id, user_sql)

user_sql= "INSERT INTO tbl_user (user_id,
username, lastipaddress, lastcompname, expires )VALUES "
user_sql= user_sql & "('" & user_id & "','" &
"','" & Request.ServerV ariables("REMOT E_ADDR") & "','" &
Request.ServerV ariables("REMOT E_USER") & "','" & user_expires &
"');"
conn.Execute(us er_sql)
end if
Jul 19 '05 #2
Just so I don't come across as a complete moron, I've already apologised to David for my harsh post having started and email discussion. Turns out that it's not his code (as I should have suspected) but as usual belongs to 'another' developer

<quote>
This is a bit of a strange one as I've inherited the maintenance of this site from another developer who is not around to advise...
</quote>
Of course ... we're all just fixing someone else's code. Seems like the industry has found a way to self-perpetuate. I write bad code and come back 2 years later to a new boss and fix it thus getting paid twice (unless I'm daft enough to leave my name in the comments of course). Wasn't me honestly, it was my evil twin brother ...

LoL.

After feeling guilty for a few mins 'we' may have found a suspect loop that appears to run indefinitely in certain circumstances thus hanging ASP.

Chris.

"Chris Barber" <ch***@blue-canoe.co.uk.NOS PAM> wrote in message news:Ot******** ******@tk2msftn gp13.phx.gbl...
<woeful-plea instyleof="Shak espearian Tragedy">
Doesn't anybody care about code readability, comments, case, error
handling, and variable declaration anymore?
</woeful-plea>

What is the function db_validate() that provides the loop exit point?

In order to debug you need to fix your code first by making judicious use
of:

Option Explicit
Dimension your variables
Place comments in the code to say what's going on.
Never have loops that don't have a 'get out' clause (eg. after 5 seconds
or 1000 loops etc.).
Include error traps to detect errors after SQL executions (implies use
of On Error Resume Next).

I'm not having a go at *you* but your post is symptomatic of a lot of very
short requests for help that are patently impossible to comment on without
the request for 'a short code section that is self-contained and
demonstrates the issue'.

To be honest, you seem to have found the issue already - examine your loop
response in debug mode and I'm sure you'll find the source of the problem.
At the very least put a get out clause in that allows you to report and
process the error (if it's an error that's occurring).

Regards,

Chris Barber.
"Max Hazelhurst" <ma**@zelhurst. com> wrote in message
news:BC4E97ED.A AA%ma**@zelhurs t.com...
Hi there,

Got an include file causing a timeout on the server when it's called on...

The code has a loop in it that I suspect may be the cause...

I can forward the entire inc file should it be necessary...

Many thanks as ever..
Max
Maxh att zelhurst dott com

if (user_id = "") Then
loggedin=false
do
user_id=generat eID(5)
user_sql="SELEC T tbl_user.user_i d FROM
tbl_user WHERE ((tbl_user.user _id)=" & user_id & ");"
loop while db_validate(use r_id, user_sql)

user_sql= "INSERT INTO tbl_user (user_id,
username, lastipaddress, lastcompname, expires )VALUES "
user_sql= user_sql & "('" & user_id & "','" &
"','" & Request.ServerV ariables("REMOT E_ADDR") & "','" &
Request.ServerV ariables("REMOT E_USER") & "','" & user_expires &
"');"
conn.Execute(us er_sql)
end if
Jul 19 '05 #3
Don't know if this would help at all:

' Script timeout in seconds for this page.
' (60 x 60 = 1 hour.)
Server.ScriptTi meout = 60 * 60

Best regards,
J. Paul Schmidt, Freelance ASP Web Developer
http://www.Bullschmidt.com
ASP Design Tips, ASP Web Database Demo, Free ASP Bar Chart Tool...
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 19 '05 #4

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

Similar topics

43
5128
by: steve | last post by:
I am quite frustrated with php’s include, as I have spent a ton of time on it already... anyone can tell me why it was designed like this (or something I don’t get)? The path in include is relative NOT to the immediate script that is including it, but is relative to the top-level calling script. In practice, this means that you have to constantly worry and adjust paths in includes, based on the startup scripts that call these...
13
2599
by: Bryan Harrington | last post by:
Hello all.. I'm working on an application that I'd like to use some shared files. Right now my directory structure is: / (root) .../Shared/ .../Reports/ .../Tools/
22
38561
by: Weston C | last post by:
I know of course that you can use <script src=""></script> in an HTML document to include javascript code you don't want to spill all over the page. I'm wondering if there's a way to include other pieces of javascript code from *within* javascript.... a la #include in C, @import in Java, use/require in Perl, include()/require() in PHP, etc.... Thanks, Weston
28
3891
by: Ramesh | last post by:
Hi, I am currently maintaining a legacy code with a very very large code base. I am facing problems with C/C++ files having a lot of un-necessary #includes. On an average every C/C++ file has around 150+ .h files included. I find 75% of the files unnecessary and could be removed. Considering the fact that I have a huge code base, I can't manually fix it. Are there any tools that would report un wanted .h files?
8
6177
by: Jacob | last post by:
Is there still a difference on the two forms of includes: #include "some/file" and #include <some/file> I always use the latter and see no rational
1
1071
by: www.espiredreams.net | last post by:
I recently started using vs2003 from vc++ 6.0. I am having the starngest of problems. I cannot include any files into my code (string.h or iostream.h). I installed vs '03 after a clean install of windows (no problems with prior versions of vs). I have checked to make sure all the include directories are correct. It just doesn't make sense to me. ANY help would be well appreciated.
4
2250
by: John Smith | last post by:
I have a project that consists of about a dozen translation units. I use a command line compiler and it occured to me that I could simplify compiling the project by #include(ing) them in a header that looks something like this: /* project.h */ #include "aaa.c" #include "bbb.c" #include "ccc.c" ....
2
1934
by: William van Zwanenberg | last post by:
Hi there, I wonder if you guys can help. I'm currently experiencing some coding problems what with trying to use PHP and javascript in tandem. What I'm ultimately trying to achieve is use Javascript to access the DOM objects of any given page within the web site I'm building to dyanamically resize any and all text elements. I have Javascript some code that works
1
3482
by: Zbigniew | last post by:
Hi, Compiler: GCC 3.3.5 OS: SuSE Linux (Kernel: 2.6.11) I reorganized my source code and now almost all my header files went to "Include" folder. Now when compiling with -I option I have plenty of problems with system include files: "conflict with previous declaration"
3
2637
by: =?Utf-8?B?VG9kZCBEb2JtZXllcg==?= | last post by:
I am working on developing a program using Visual Studio 2003 but am having problems getting my program to find my GL.h and GLU.h, and I am guessing it will have the same problems trying to link to the .lib and .dll files. What do I all need to do to get this to properly compile and link. Here is what I have done so far. Inside my main project directory, I added a folder called "OpenGL" and inside this folder are 3 sub-folders,...
0
9643
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
9480
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
10147
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
9947
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8968
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...
1
7494
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6737
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();...
0
5511
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4045
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

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.