Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2006
    Posts
    44

    Unanswered: 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

  2. #2
    Join Date
    Nov 2005
    Location
    Honolulu HI
    Posts
    119
    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.HawaiianHope.org
    Providing Technology services to non profit orgs, Homeless Shelters, Food Pantries, Clean And Sober Houses and more.
    To date we have given away over 900 free computers !
    __________________________
    caeli enarrant gloriam Dei !

  3. #3
    Join Date
    Jan 2006
    Posts
    44
    thanx, i got it solve in another way...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •