473,508 Members | 2,249 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

asp loop question

120 New Member
hi guys

i think i may have a syntax error but im not sure. im basically getting stuck where my if statement checks to see if column 'outbound_route' contains 'London Gatwick to Vancouver' then print some html but no html is printing and im not getting any errors either.

Expand|Select|Wrap|Line Numbers
  1. IF objRSYVRROUNDTRIPS("outbound_route") = "London Gatwick to Vancouver" THEN
  2.     Response.Write "<li><a href=""#LGWYVR"">London Gatwick</a></li>"
  3. End If
complete code
Expand|Select|Wrap|Line Numbers
  1. <%
  2. 'CHECK FOR PRICES
  3. DIM objYVRROUNDTRIPS
  4. Set objYVRROUNDTRIPS = Server.CreateObject("ADODB.Connection")
  5. objYVRROUNDTRIPS.ConnectionString = "Provider=SQLOLEDB;Data Source=hidden;" & _
  6. "Initial Catalog=Prices;User ID=hidden;Password=hidden"
  7. objYVRROUNDTRIPS.Open
  8.  
  9. DIM YVRROUNDTRIPS
  10. YVRROUNDTRIPS = "SELECT * FROM UK_Specials_Round_Trips WHERE outbound_route LIKE ('%to vancouver%')"
  11.  
  12. DIM objRSYVRROUNDTRIPS
  13. Set objRSYVRROUNDTRIPS = Server.CreateObject("ADODB.Recordset")
  14. objRSYVRROUNDTRIPS.Open YVRROUNDTRIPS, objYVRROUNDTRIPS
  15.  
  16. 'check to see if there are any prices
  17. If (NOT IsNull(objRSYVRROUNDTRIPS("Price"))) Then 
  18. Response.Write "<fieldset><legend>to <span class=""red"">Vancouver (YVR)</span> from</legend>"
  19. Response.Write "<table width=""100%"" align=""center"" cellpadding=""0"" cellspacing=""0"">"
  20. Response.Write "<tr><td><ul>"
  21.  
  22. IF objRSYVRROUNDTRIPS("outbound_route") = "London Gatwick to Vancouver" THEN
  23.     Response.Write "<li><a href=""#LGWYVR"">London Gatwick</a></li>"
  24. End If
  25.  
  26. Response.Write "</tr></table></fieldset>"
  27.  
  28. End If
  29.  
  30. objRSYVRROUNDTRIPS.Close
  31. Set objRSYVRROUNDTRIPS = Nothing
  32. objYVRROUNDTRIPS.Close
  33. Set objYVRROUNDTRIPS = Nothing
  34. %>
my sql query
Expand|Select|Wrap|Line Numbers
  1. SELECT * FROM UK_Specials_Round_Trips WHERE outbound_route LIKE ('%to vancouver%')
outputs this
ID PRICE OUTBOUND_ROUTE OUTBOUND_DATE INBOUND_ROUTE INBOUND_DATE
7 318 Glasgow to Vancouver May 4 2011 Vancouver to Glasgow May 11 2011
8 318 Glasgow to Vancouver May 11 2011 Vancouver to Glasgow May 18, Jun 08,15,22 2011
9 598 Glasgow to Vancouver Jun 22 2011 Vancouver to Glasgow Jul 6 2011
10 598 Glasgow to Vancouver Aug 10 2011 Vancouver to Glasgow Aug 17 2011
11 318 Glasgow to Vancouver May 11 2011 Calgary to Glasgow May 18, 25, Jun 1, 8 2011
22 318 London Gatwick to Vancouver Mar 24 2011 Vancouver to London Gatwick Mar 31 2011
23 318 London Gatwick to Vancouver Mar 27 2011 Vancouver to London Gatwick Apr 3, 30, May 6 2011
24 499 London Gatwick to Vancouver Mar 31, Apr 03 2011 Vancouver to London Gatwick Apr 3, 30, May 5, 6 2011
25 318 London Gatwick to Vancouver Apr 30 2011 Vancouver to London Gatwick May 5, 6 2011
26 318 London Gatwick to Vancouver Apr 28,30 May 6,8,10,12,13,15 2011 Vancouver to London Gatwick May 4, 5, 6, 8, 12, 13, 15, 17,19,20,22,27,29 2011
27 529 London Gatwick to Vancouver Aug 30 2011 Vancouver to London Gatwick Sep 06 2011
69 398 Manchester to Vancouver May 6, 7 2011 Vancouver to Manchester May 13, 14 2011
70 318 Manchester to Vancouver May 13, 14 2011 Vancouver to Manchester May 21 2011
71 318 Manchester to Vancouver May 20 2011 Vancouver to Manchester May 27 2011


please help

thanks
omar.
Mar 24 '11 #1
1 1464
omar999
120 New Member
will this code be of any use?

Expand|Select|Wrap|Line Numbers
  1. IF (objRSYVRROUNDTRIPS.Fields.Item("outbound_route").Value) & "London Gatwick to" THEN
  2.     Response.Write "test"
  3. End If    
  4.  
??
Mar 24 '11 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
3081
by: John | last post by:
Hi there folks... Just wondering if someone can help a newbie to VB!? I'm running some stuff in a For loop. Each time the loop runs it makes a change to a value which it should display in a...
24
1659
by: Tweaxor | last post by:
This has been puzzling me all this week. This is actually a homework assignment from last semesmter. But the teacher wouldn't tell us why certain things didn't work, but it didn't just work. My...
14
1607
by: morpheus | last post by:
Hi Group, May I ask the following? for (i=0; (c=getchar()) != EOF && c != '\n'; ++i) line=c; What I am finding is that when c == '\n' is true, the loop is terminated but i is still...
4
1233
by: bruce | last post by:
hi.. basic foor/loop question.. i can do: for a in foo print a if i want to do something like
11
1651
by: logicode | last post by:
I need a loop that can be put in 3 instances. I am not sure which loop I can find and I dont want to use a switch statement so can you help? I Already know the code just the loop for it. ...
10
6254
by: Milo Daemon | last post by:
Hi, i am extremely new to python and i've been following a tutorial about learning to programm with python. After reading through the tutorial and answering the questions given by it i findally came...
11
1584
by: SM | last post by:
I have a couple of arrays that represent different categories. One array per category. The arrays contain names of photos. The arrays look like this: $cat_1 = array('moonlight.jpg'',...
2
965
by: takayuki | last post by:
Hi everyone, I'm studying python via the excellent "how to think like a python programmer" book by Allen Downey. Noob question follows... I have a txt file (animals.txt) which contains the...
3
2032
by: troy_lee | last post by:
I have a form that asks for the month, the year, the number of weeks in the month and the beginning date for the month. I want to be able to: Number the weeks (e.g. 1, 2,3, etc.) Assign a...
7
3486
by: gordon | last post by:
is it possible to send a message to the gui instance while the Tk event loop is running?I mean after i create a gui object like root=Tk() mygui=SomeUI(root) and call root.mainloop() can i...
0
7225
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
7123
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...
0
7326
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
7383
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...
1
7046
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...
1
5053
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...
0
3182
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1557
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 ...
1
766
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.