473,385 Members | 2,269 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,385 software developers and data experts.

Looping code for an unknown reason!

Hi,

Im pretty new to asp so all light on this question would be great.

Basically i need to test to see what value is set (where to retrieve the
data from) so ive done it like this:

If Request.Querystring("id") = "" then
TidF=Request.Form("TidF")
Else
TidF=Request.Querystring("id")
End If

The data Request.Form("TidF") comes from a form if submit is pressed.

The data Request.Querystring("id") comes from the url being .asp?id=number

However it seems to keep looping round even though i have ended the if
statement and set the var.

all help would be great thanks.
Oct 23 '06 #1
6 1791
There's nothing here that would cause a loop. What makes you think
something's looping?

Ray at work

<ea********@gmail.comwrote in message
news:vN********************@eclipse.net.uk...
Hi,

Im pretty new to asp so all light on this question would be great.

Basically i need to test to see what value is set (where to retrieve the
data from) so ive done it like this:

If Request.Querystring("id") = "" then
TidF=Request.Form("TidF")
Else
TidF=Request.Querystring("id")
End If

The data Request.Form("TidF") comes from a form if submit is pressed.

The data Request.Querystring("id") comes from the url being .asp?id=number

However it seems to keep looping round even though i have ended the if
statement and set the var.

all help would be great thanks.


Oct 23 '06 #2
Ray Costanzo [MVP] wrote:
There's nothing here that would cause a loop. What makes you think
something's looping?

Ray at work

<ea********@gmail.comwrote in message
news:vN********************@eclipse.net.uk...
>Hi,

Im pretty new to asp so all light on this question would be great.

Basically i need to test to see what value is set (where to retrieve the
data from) so ive done it like this:

If Request.Querystring("id") = "" then
TidF=Request.Form("TidF")
Else
TidF=Request.Querystring("id")
End If

The data Request.Form("TidF") comes from a form if submit is pressed.

The data Request.Querystring("id") comes from the url being .asp?id=number

However it seems to keep looping round even though i have ended the if
statement and set the var.

all help would be great thanks.


At a certain point the code seems to loop round the whole script and
dosent halt ever since ive added in them lines.

Here is my code:

http://rafb.net/paste/results/qXOfJn50.html

Thanks agian.
Oct 23 '06 #3

<ea********@gmail.comwrote in message
news:vN********************@eclipse.net.uk...
Hi,

Im pretty new to asp so all light on this question would be great.

Basically i need to test to see what value is set (where to retrieve the
data from) so ive done it like this:

If Request.Querystring("id") = "" then
TidF=Request.Form("TidF")
Else
TidF=Request.Querystring("id")
End If

The data Request.Form("TidF") comes from a form if submit is pressed.

The data Request.Querystring("id") comes from the url being .asp?id=number

However it seems to keep looping round even though i have ended the if
statement and set the var.

all help would be great thanks.

There is no way this code can loop. What makes you think it is looping?

Oct 23 '06 #4
The only loop you have in your code starts on line 99. And best as I can
tell, you'll loop through there just fine. (Although I am wondering why you
don't have " AND filled='Y'" in your query.) Inside of your loop, say at
line 100, put this:

Response.Write "In the loop.<hr>"
Response.Flush

What do you see when you load the page?

Ray at work


<ea********@gmail.comwrote in message
news:IO******************************@bt.com...
Ray Costanzo [MVP] wrote:
>There's nothing here that would cause a loop. What makes you think
something's looping?

Ray at work

<ea********@gmail.comwrote in message
news:vN********************@eclipse.net.uk...
>>Hi,

Im pretty new to asp so all light on this question would be great.

Basically i need to test to see what value is set (where to retrieve the
data from) so ive done it like this:

If Request.Querystring("id") = "" then
TidF=Request.Form("TidF")
Else
TidF=Request.Querystring("id")
End If

The data Request.Form("TidF") comes from a form if submit is pressed.

The data Request.Querystring("id") comes from the url being
.asp?id=number

However it seems to keep looping round even though i have ended the if
statement and set the var.

all help would be great thanks.


At a certain point the code seems to loop round the whole script and
dosent halt ever since ive added in them lines.

Here is my code:

http://rafb.net/paste/results/qXOfJn50.html

Thanks agian.

Oct 23 '06 #5
Ray Costanzo [MVP] wrote:
The only loop you have in your code starts on line 99. And best as I can
tell, you'll loop through there just fine. (Although I am wondering why you
don't have " AND filled='Y'" in your query.) Inside of your loop, say at
line 100, put this:

Response.Write "In the loop.<hr>"
Response.Flush

What do you see when you load the page?

Ray at work


<ea********@gmail.comwrote in message
news:IO******************************@bt.com...
>Ray Costanzo [MVP] wrote:
>>There's nothing here that would cause a loop. What makes you think
something's looping?

Ray at work

<ea********@gmail.comwrote in message
news:vN********************@eclipse.net.uk...
Hi,

Im pretty new to asp so all light on this question would be great.

Basically i need to test to see what value is set (where to retrieve the
data from) so ive done it like this:

If Request.Querystring("id") = "" then
TidF=Request.Form("TidF")
Else
TidF=Request.Querystring("id")
End If

The data Request.Form("TidF") comes from a form if submit is pressed.

The data Request.Querystring("id") comes from the url being
.asp?id=number

However it seems to keep looping round even though i have ended the if
statement and set the var.

all help would be great thanks.
At a certain point the code seems to loop round the whole script and
dosent halt ever since ive added in them lines.

Here is my code:

http://rafb.net/paste/results/qXOfJn50.html

Thanks agian.

Hi,

Unfortunately that didn't work.

Heres 2 links to videos that explain this abit better!

http://another-site.net/working.avi

http://another-site.net/failed.avi

The first one (working.avi) shows it functional when you use a number
other than 99999. This number is used to manually prompt for a
javascript input box that posts the data back to the page. It works but
it seems to loop round and keep logging in and out.

Thanks agian.
Oct 23 '06 #6
ea********@gmail.com wrote:
Ray Costanzo [MVP] wrote:
>There's nothing here that would cause a loop. What makes you think
something's looping?

Ray at work

<ea********@gmail.comwrote in message
news:vN********************@eclipse.net.uk...
>>Hi,

Im pretty new to asp so all light on this question would be great.

Basically i need to test to see what value is set (where to
retrieve the data from) so ive done it like this:

If Request.Querystring("id") = "" then
TidF=Request.Form("TidF")
Else
TidF=Request.Querystring("id")
End If

The data Request.Form("TidF") comes from a form if submit is
pressed. The data Request.Querystring("id") comes from the url being
.asp?id=number However it seems to keep looping round even though i have
ended the
if statement and set the var.

all help would be great thanks.


At a certain point the code seems to loop round the whole script and
dosent halt ever since ive added in them lines.

Here is my code:

http://rafb.net/paste/results/qXOfJn50.html
Well obviously we cannot test your code to see the symptoms that lead you to
believe that you have an infinite loop, so you're going to have to help us
out. Start by showing us the source of the page that results from running
this code. Put in some response.writes of your variable values at various
places so we can see what is happening.

Having said that, your coding practices could use some work (yes, I know you
are new to this ... this is not destructive criticicsm: it's intended as
constructive). These do not have anything to do with your problem (I think),
but you should address them:

1. Your connection string - http://www.aspfaq.com/show.asp?id=2126
2. Selstar - http://www.aspfaq.com/show.asp?id=2096
3.Costly recordset loop - http://www.aspfaq.com/show.asp?id=2467
4. Major:problem:
Your use of dynamic sql is leaving you vulnerable to hackers using sql
injection:
http://mvp.unixwiz.net/techtips/sql-injection.html
http://www.sqlsecurity.com/DesktopDefault.aspx?tabid=23

See here for a better, more secure way to execute your queries by using
parameter markers:
http://groups-beta.google.com/group/...e36562fee7804e

Personally, I prefer using stored procedures, or saved parameter queries as
they are known in Access:

http://www.google.com/groups?hl=en&l...TNGP12.phx.gbl

http://groups.google.com/groups?hl=e...tngp13.phx.gbl
--
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"
Oct 24 '06 #7

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

Similar topics

53
by: Cardman | last post by:
Greetings, I am trying to solve a problem that has been inflicting my self created Order Forms for a long time, where the problem is that as I cannot reproduce this error myself, then it is...
11
by: Lues | last post by:
Hi, I'm trying to protect some data in tables with encription (you know why, don't you ;)) I must confess that I'm not very expirienced in writing code, especially encription code. Can any...
8
by: RC | last post by:
I have a table that lists many box numbers. Each box number has a Pallet Number (indicating which pallet the box is in). When the Pallets are loaded into a shipping Container I need to update the...
45
by: Trevor Best | last post by:
I did a test once using a looping variable, first dimmed as Integer, then as Long. I found the Integer was quicker at looping. I knew this to be true back in the 16 bit days where the CPU's (80286)...
5
by: masood.iqbal | last post by:
My simplistic mind tells me that having local variables within looping constructs is a bad idea. The reason is that these variables are created during the beginning of an iteration and deleted at...
5
by: johnb41 | last post by:
I need to loop through a bunch of textbox controls on my form. The order of the loop is very important. For example, the top one must be read first, then the one below it, etc. My first...
13
by: JayCallas | last post by:
I know this question has been asked. And the usual answer is don't use cursors or any other looping method. Instead, try to find a solution that uses set-based queries. But this brings up...
5
by: Jeff | last post by:
Hey gang. I have a script that gets stats from a mssql db, and then inserts those stats into a temp table. where i can work with them as i wish. the problem is it isn't looping through all the...
2
by: pedalpete | last post by:
Hi All, I'm using Bill Scott's YUI carousel v5.6, and I've run into a crazy looping javascript for some reason, and I can't seem to get around it. The carousel loads a bunch of items, 7 of...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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...

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.