If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > Syntax error for session

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-01-06, 22:40
Cuttie0506 Cuttie0506 is offline
Registered User
 
Join Date: Jan 2006
Posts: 44
Syntax error for session

Hi, i got a syntax error, which i cant solve it.. I have look through it and cant find where i have went wrong.. Hope some1 can help me..

Thanx

Code:
		While (NOT rs_vWeek.EOF)	
			Response.write "<option value='" & (rs_vWeek.Fields.Item("Weekly").Value) & "'" & If (Not isNull((Session("week")))) Then If (CStr(rs_vWeek.Fields.Item("Weekly").Value) = CStr((Session("week")))) Then Response.Write("SELECTED") & ">" & (rs_vWeek.Fields.Item("Weekly").Value) & "</option>"					
		rs_vWeek.MoveNext()
		Wend

			If (rs_vWeek.CursorType > 0) Then
				rs_vWeek.MoveFirst
			Else
				rs_vWeek.Requery
			End If
Reply With Quote
  #2 (permalink)  
Old 02-02-06, 01:13
kropes2001 kropes2001 is offline
Registered User
 
Join Date: Nov 2005
Location: Honolulu HI
Posts: 118
why all of the parenthases ?
OK, wow...
it looks like you tried to convert javascript over to VB script or something...

you have an IF/ THEN on the same line as the end of the "/OPTION"
it will only hit the "</option>" if the IF is true...

Something like that would work in javascript but not in VB script / ASP
(unless i am completely un aware of that functionality... for the past 10 years)

try something like this
Code:
		DO While NOT rs_vWeek.EOF
			strSelected=""
			IF LEN(Session("week"))>0 THEN
				IF CStr(rs_vWeek("Weekly")) = CStr(Session("week")) Then 
					strSelected=" SELECTED"
				END IF
			END IF

			Response.write "<option value='" & rs_vWeek("Weekly") & "'" & strSelected & ">" & rs_vWeek.Fields("Weekly") & "</option>"					rs_vWeek.MoveNext
		LOOP

			If rs_vWeek.CursorType > 0 Then
				rs_vWeek.MoveFirst
			Else
				rs_vWeek.Requery
			End If
__________________
.
.
http://www.GetMySiteOnline.com - Can you help me Get My Site Online ? (Yes. That is EXACTLY what we do.)

http://www.GetMySiteOnline.com/FightingSpam/
__________________________
caeli enarrant gloriam Dei !
Reply With Quote
  #3 (permalink)  
Old 02-02-06, 20:05
Cuttie0506 Cuttie0506 is offline
Registered User
 
Join Date: Jan 2006
Posts: 44
thanx, i got it solve in another way...
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On