473,396 Members | 1,996 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

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=generateID(5)
user_sql="SELECT tbl_user.user_id FROM
tbl_user WHERE ((tbl_user.user_id)=" & user_id & ");"
loop while db_validate(user_id, user_sql)

user_sql= "INSERT INTO tbl_user (user_id,
username, lastipaddress, lastcompname, expires )VALUES "
user_sql= user_sql & "('" & user_id & "','" &
"','" & Request.ServerVariables("REMOTE_ADDR") & "','" &
Request.ServerVariables("REMOTE_USER") & "','" & user_expires &
"');"
conn.Execute(user_sql)
end if

Jul 19 '05 #1
3 2069
<woeful-plea instyleof="Shakespearian 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.AAA%ma**@zelhurst.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=generateID(5)
user_sql="SELECT tbl_user.user_id FROM
tbl_user WHERE ((tbl_user.user_id)=" & user_id & ");"
loop while db_validate(user_id, user_sql)

user_sql= "INSERT INTO tbl_user (user_id,
username, lastipaddress, lastcompname, expires )VALUES "
user_sql= user_sql & "('" & user_id & "','" &
"','" & Request.ServerVariables("REMOTE_ADDR") & "','" &
Request.ServerVariables("REMOTE_USER") & "','" & user_expires &
"');"
conn.Execute(user_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.NOSPAM> wrote in message news:Ot**************@tk2msftngp13.phx.gbl...
<woeful-plea instyleof="Shakespearian 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.AAA%ma**@zelhurst.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=generateID(5)
user_sql="SELECT tbl_user.user_id FROM
tbl_user WHERE ((tbl_user.user_id)=" & user_id & ");"
loop while db_validate(user_id, user_sql)

user_sql= "INSERT INTO tbl_user (user_id,
username, lastipaddress, lastcompname, expires )VALUES "
user_sql= user_sql & "('" & user_id & "','" &
"','" & Request.ServerVariables("REMOTE_ADDR") & "','" &
Request.ServerVariables("REMOTE_USER") & "','" & user_expires &
"');"
conn.Execute(user_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.ScriptTimeout = 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
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...
13
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
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...
28
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...
8
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
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...
4
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...
2
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...
1
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...
3
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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,...
0
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
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...
0
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,...

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.