Nested If Else Conditional Statament

I am not too sure wats wrong w the if-else statement below!

<%if(grp==grp2)%>
{
<%if (start==req || end==req)%>
{
<%=grp%>
<%=start%>
<%=end%>
}
<%else%>
{
<%="There is no such record found"%>
}
}
<%else%>
{
<%="There is no such record found!"%>
}
<%endif%>

Error: 'else' without 'if'.
else
^

View Replies


ADVERTISEMENT

Nested Loops

What I'm trying to do is match all buyer requirements in a database table to all available properties in another table. I then want all these matches displayed in a report with the buyer name followed by the relevant matching properties, this should occur until all buyers have been displayed with their matching properties.

The problem is that it only works correctly for the first buyer for which the correct properties are displayed, after that all I get is the buyer names without their matching properties... so it seems to loop perfectly the first time but from then on forgets about the inner loop! Code:

View Replies View Related

Nested Menu

My last (maybe) problem is to make a nested menu (I think is possible only with Java) and I must take the names of the selections from a DB ...
is possible? I can't find documents where is explained how to use MDB files with Java

View Replies View Related

Nested Recordsets

I have an array of items and for each item I need to find sizes and and for each size I need to find colors The array of items comes from the previous page. Code:

View Replies View Related

Nested Subroutines

I am using IIS 5.0, ASP and VBScript. I am puzzled by recurrences of errors when I nest subroutines, and I'd like to know if there are rules for that which I don't know. Would functions work better instead? I am not much of a coder.

View Replies View Related

Nested SHAPE

I'm using the following SHAPE command:

SHAPE {SELECT * FROM Chapters WHERE SchoolID=320}
APPEND ({SELECT * FROM ChapterLink}
RELATE ID TO ChapterID) AS Advisors
({SELECT FirstName, LastName FROM LocalAdvisors }
RELATE UserName TO UserName) AS AdvName

I get an error, "Column (UserName) does not exist in the appropriate rowset", which is correct, the UserName column actually exists in the ChapterLink table. But, I can't figure out how to construct this SHAPE command so that it works like that.

View Replies View Related

Nested Loop

I want to loop through a certain number of records in the recordset and then create a second loop for the remaining records. How do I capture the last record on the first loop to use in the second loop?

View Replies View Related

Nested Recordsets

I have taken over a program that uses a mixture of javascript and clasic ASP. However i am trying to get rid of the javascript and just use ASP.

However the code uses a nested recordset as the secpnd recordset needs a result from the first to run correctly. I have managed to change the code so that it goes through the first record but I can't get it to loop through the other recordsets. So it writes one results and then just a blanks.

Is it possible to use nested recordsets for more than one result? If not what are my options for fixing this problem?

View Replies View Related

Nested SQL SELECT Commands?

I have an ASP page where I build a html table dynamically by reading a database table and populating the <TD> cells with the fields of each record.

I want the last field to be a html drop down list that contains values read from another db relation in the same db. It would seem to me, (i'm novice) that this would require nesting SQL SELECT Code:

View Replies View Related

Repeated Recordsets (nested)

I am trying to produce a results page where the results come from three seperate tables.

e.g. The main query gets a list of results, for each one of those results I need to display data from another table. I have a list of bars, restaurants, hotels etc.

I want to display the details of those in sections (a bar section showing all the bars etc) each one of the bars is ranked by members. When I do this I get a "type mismatch" which I guess comes from the fact I am trying to equate an array to a single value. How do I get round this? Code:

View Replies View Related

Error Messages Nested

When an HTTP 500.100 occure in IIS 5.0, I was getting redirected to a HTTP 500.100 -'page cannot be displayed' error page when there was an error, but now in IIS 6.0, I get 'Microsoft VBScript runtime error '800a01c2' ' nested within the page.

I'm trying to create my own error messages so it will re-direct to my own error page and send me an email. I used to be able to do this in IIS 5.0 but I can't seem to get it going in IIS 6.0 as it doesn't re-direct to a default error message.how to get IIS 6.0 to work like IIS 5.0, or is there another way of doing it, or is this not even an IIS problem.

View Replies View Related

Triple Nested Quotes

Can someone tell me how to write this line so I don't get an error - I've tried various ways to nest the quotes,but I still get an error saying that an ")" is expected.

Code:

response.write("document.write('<form method="post" action="message_send.asp?subject=" & _
Request.QueryString("subject") & "" onsubmit="return preValidate(this);">);")


Is there any other way to feed the result of an ASP function into Javascript other than by getting ASP to write out the JS as above?

View Replies View Related

Nested For Each Overload Array

I would like to know what I'am doing wrong with this loop & Array's... Keeps over oading but unsure why... Would anyone know why and know a sollution?

ERROR:
Microsoft VBScript runtime (0x800A0009)
Subscript out of range: '6'

CODE:
For Each i in TArrSpl
For Each e in TId_Arr

IF TId_Arr(e) = TArrSpl(i) THEN
' CODE
ELSE
' CODE
END IF
Next
Next

View Replies View Related

Read Nested Nodes In XML File With ASP

I have to read a XML file in ASP and save the values in a database. I can get this work, but I cannot read some nested nodes of the xml file. This is a part of the XML file: Code:

View Replies View Related

Passing Value With Nested Repeating Region

I am passing values from Supplier_Details.asp to Supplier_Products.asp, when I click to view the details of the supplier I want, their values goe to the other page ( supplier_product)that I want all his products to be displayed.

so far I can pass values and could be displayed, no problem but when it comes to displaying all the products, it;s then where I am stuck, with the previous tutorials ( nested repeat region) I can get it working and I tried to have that example working for all this, so far it;s not, so is it possible to do it ? Code:

View Replies View Related

Nested Includes Not Working As Intended

I'm working on a new site that has a nearly empty index file (variable
location) that includes a template file (set location) which in turn
includes two data files (variable location dependent on index file's
location). This concept worked in PHP and I'm just playing around with it
in ASP to see if it can make my site management easier because I can't move
to Apache for a while.

It seems that the template file can only include relative to itself and also
with specific paths, but it can't include relative to the original index
file.

View Replies View Related

Conditional IF

I have a form with a list/menu where you select the year you were born. Now, when I submit this form, it creates a new register in my database etc.

How can I use a conditional to redirect a person that for example was born in 1987 or less?

if request.form("year")="1987" then%> is this the correct way to start?

View Replies View Related

URL Conditional

I have a ton of dynamic pages that I need an asp conditional to run on.I know the urls of all the pages and I want to know if there is an easy way to write a conditional statement that if they are on a specific page that it outputs something depending on the url they are on. Is there an easy way to do this?

View Replies View Related

Conditional

I have the following simple conditional on my page,

If EmpIDError <> 1 Then
'Show Input items
End If

Now I need to add another conditional to this,

If PosIDError <> 1 Then
'Show input items
End If

So I made it like this,

If EmpIDError <> 1 OR PosIDError <> 1 Then

But the problem is that if PosIDError = 1, then it still shows the input
items. But if I take the EmpIDError <> 1 out then it works with no
problems. Why would this be like this?

View Replies View Related

Conditional Statement

I've got the following VB in an ASP page and can't see why it won't work

<% if Request.QueryString(Failed=="N")%> The Failed variable is N <% else
%>The failed variable is not N<% end if %>

I'm calling the page as thepage.asp?Failed=N

View Replies View Related

Conditional Inculde

I have written a small library for ASP, and I tried to keep it in a modular fashion, splitting my library in some files.

Then I have a file named "framework.asp" that include all the other files.

The problem is that I can't reuse code internally to my library because if for example:

framwork.asp include:
- utils.asp
-html.asp

Then html.asp include:
-utils.asp

If the programmer include framework.asp would have 2 times the same file utils.asp in his ASP page! Code:

View Replies View Related

Conditional Statement

I have a code for executing a stored procedure and returning a recordset wrapped in an IF statement. If the statement is true the code executes. If the statement is false the code is skipped.

On the page, I want to display a message if the Recordset returned from the stored procedure is empty.

<% If rs.BOF or rs.EOF Then %>

Message

<% End If %>

Running the above code will return an error message if the recordset object doesn't exist...i.e. if the stored procedure hasn't executed and returned the recordset object.

How can I write the code to include that condition?

View Replies View Related

Conditional Includes

Will this work in asp 3.0:

If True Then
<!-- #include file="test1.asp" -->
Else
<!-- #include file="test2.asp" -->
End If

View Replies View Related

Conditional Formatting

i have an simple invoice sheet and in "total" coloumn i need to put a formula like IF < 8.50 THEN VALUE =8.50.it is something like we dont do delivery less then 8.50 so if the TOTAL is less than 8.50 then it should turn in to 8.50 automatically.

View Replies View Related

Conditional Compilation

One of my asp pages can be loaded in two ways - it may be submitted to itself (and therefore contains user data) or it can be loaded by clicking on a link on my menu, and consequently all fields are empty.

If the fields contain values (ie. the submit button was pressed), i want to load data from my database into an array, but if it is accessed via a link, i don't want this data to be loaded. So essentially, i want to know if there is some form of conditional compilation or something in asp (i know it technically shouldn't be called that, but i'm coming from a c++ background, so...) similar to the #if and #elif type directives in C

I can't place the code in a subprogram and selectively call it, because I want the arrays to be global so all my client-side scripts can access the data I'm using VBScript for the asp scripting.

View Replies View Related

Conditional Sql Statements

I have a shopping cart that I want to load items in that come from a huge scrolling form. In other words, when someone clicks on a category in our site, it scrolls out all the items in that category, maybe 30 or more. I have text boxes next to each item so somone can enter a number, then press submit form button at the bottom of the form, and
send those slections to the shopping cart.

The problem is, many of the text boxes are empty, yet they are still being sent to the shopping cart as a quatity of 0. Is there a way for sql to ignore a value if the variable is zero, or only get the sql statement to run if a variable is > 0?

View Replies View Related

Conditional Display Of Data From DB

displays content IF several conditions exist or display's nothing if it doesn't?

Basically, in english this is what I'm trying to do:

IF a record exists

WHERE session(userID) = idByUserID in 'notes'
AND
WHERE userID = idAboutUserID in 'notes'

THEN

display from the record fieldnames 'LastUpdate' and 'note'

ELSE
don't display anything

View Replies View Related

Conditional Page Re-direct

I have a 'primary' intranet website and a 'secondary' backup of this site as
well. I would like to programmatically have the effect that if the
primary site is (page not found 404) not available, for it to access the
secondary site or at least be able to add a message with (or instead of) the
404 error dialog that the primary site is down and give the user a link to
the alternative (secondary) site.

View Replies View Related

Evaluating A QueryString In A Conditional

Ok I know this is simple but I cannot get it to work.
on the URL I have:

.../default.asp?strCode=xxx

I then have:

If Request.QueryString("strCode") = "xxx" Then
Response.Write "code is XXX"
End If

So for some reason it is not evaluating the queryString and does not enter into the conditional. Why?

View Replies View Related

Conditional Routine And Date

I'm trying to not show some data dependant on date but it never works right.

<% If Request.QueryString("EventDate") > DateAdd("d",6,Date()) Then %>

I have used similar routines before and it worked fine but this time i'm using a QueryString instead of a database field.

View Replies View Related

Advanced Conditional Statement

URLURLI need help writiing an advanced conditional statement.I want to display an image if two recordset values = 1 or other various number combinations.

This statement works with one, how could I edit this statement to include two recordsets values? Say I want to add another feild say "recent" to this statement and it has a value of 2

Code:

<% if Recordset1.Fields.Item("progress").Value = 1 then ' Adv Conditional Region %>
<% end if ' Recordset1.Fields.Item("progress").Value = 1 %>

View Replies View Related

Conditional Statement On DB Currency Field

Given a value in a database (Access) of type Currency how do I write a conditional statement such as the following:

if rs("price") > "$1,000,000" Then
Response.Write " Luxury Home"
End If

When I try this it writes out Luxury Home for every record, regardless of the value in Price.

View Replies View Related

Dreamweaver Conditional Statement Code

I'm just trying to figure out what the colon : does in this code:

<%If (Not isNull(COLOR)) Then If (COLOR = "Blue") Then Response.Write("SELECTED") : Response.Write("")

I thought it may be the ASP version of the Ternary operator, but it doesn't have the same effect. Is it just another way to concatenate? or a reverse concatenate?
or maybe a addition of an empty string to make sure that the output from the response.write statement is a string and not a number?

If the second response statement has a value then it prints it e.g. Code:

View Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved