Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Community Forums
 Code Support: ASP.NET (Non-Forum Related)
 expected end ?
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

Alfred
Senior Member

USA
1527 Posts

Posted - 10 December 2003 :  17:31:10  Show Profile  Visit Alfred's Homepage
quote:
Error Type:
Microsoft VBScript compilation (0x800A03F6)
Expected 'End'
/BG/forums/Admin_Games_update_handler.asp, line 356


Whenever I see this error I assume there is an "end if" missing.
However, even after I simply add "end ifs" to the bottom of the file it keeps asking for more!
quote:

my_Conn.close
set my_Conn = Nothing

end if
end if
end if
end if
%>

Now I know that I can't have left so many if statements unclosed - could this error msg mean something else?

Alfred
The Battle Group
CREDO

laser
Advanced Member

Australia
3859 Posts

Posted - 10 December 2003 :  18:18:58  Show Profile
Hey Alfred (long time no see, I was beginning to worry !!)

End could mean a few things - End function, End If, etc...

Check your code, make sure it's properly indented, and the problem usually appears.
Go to Top of Page

Alfred
Senior Member

USA
1527 Posts

Posted - 10 December 2003 :  21:04:30  Show Profile  Visit Alfred's Homepage
Hi Laser!
Not hearing of me in a while is a good sign -
it means I am getting thigs done on my own.

However, this one is puzzling me, and I have to check for unclosed functions now. If I just end function without knowing, may it be ok?

Alfred
The Battle Group
CREDO
Go to Top of Page

Alfred
Senior Member

USA
1527 Posts

Posted - 10 December 2003 :  21:23:25  Show Profile  Visit Alfred's Homepage
I didn't even find a function in the file, and all the ifs seem to have end ifs with them.
This is the txt file:
http://www.ggholiday.com/bg/forums/admin_Games_update_handler.txt

Alfred
The Battle Group
CREDO
Go to Top of Page

laser
Advanced Member

Australia
3859 Posts

Posted - 10 December 2003 :  21:43:37  Show Profile
I think I found your problem ... you are using "else if" rather then "ElseIf" (note, the second one doesn't have a space). So remove the spaces wherever you have them between the two.

Also, I think you should delete lines 230 & 231 - I think you just shoved them in there to work it work ? not needed.
Go to Top of Page

Alfred
Senior Member

USA
1527 Posts

Posted - 10 December 2003 :  22:13:36  Show Profile  Visit Alfred's Homepage
Yes, that must have been it!
Because when I cleaned it up it now works.

That logic is pretty hard to grasp:
it's end if, but elseif.

Thanks Laser!

Alfred
The Battle Group
CREDO
Go to Top of Page

laser
Advanced Member

Australia
3859 Posts

Posted - 10 December 2003 :  22:48:02  Show Profile
Not hard at all really The End command can be used for a variety of End's, whereas the ElseIf is an optional section within the If.

Personally, I rarely use ElseIf because the syntax changes in almost every language.

To blur the lines a bit more, you could use "Else If" if you close the second If within the Else as in ...


If .... Then
    blah
Else 
    If
        ....
    End If
End If


If you use ElseIf then you only need one End If.
Go to Top of Page

Alfred
Senior Member

USA
1527 Posts

Posted - 10 December 2003 :  23:12:34  Show Profile  Visit Alfred's Homepage
Oh, wonderful!
One more thing - can you spot the error here:
quote:
memID = request.form("honoredPlayer")
medalID = request.form("medalType")
medalScen = request.form("medalScen")

strSql = "INSERT INTO member_medals " &_
"(member_ID, medal_ID, Scenario) VALUES (" & memID & ", " & medalID & "," & MedalScen & ")"
my_Conn.execute(strSql)



quote:
Syntax error (missing operator) in query expression 'Pursuit to Tobruk'.
/BG/forums/Admin_medals_Add_handler.asp, line 23


Alfred
The Battle Group
CREDO
Go to Top of Page

redbrad0
Advanced Member

USA
3725 Posts

Posted - 10 December 2003 :  23:31:33  Show Profile  Visit redbrad0's Homepage  Send redbrad0 an AOL message
What are database column types for the three fields. If its a text field then you need to have '" & MedalScen & "'

If its a numeric field then you do not have to have the 's

Brad
Oklahoma City Online Entertainment Guide
Oklahoma Event Tickets
Go to Top of Page

Alfred
Senior Member

USA
1527 Posts

Posted - 10 December 2003 :  23:55:31  Show Profile  Visit Alfred's Homepage
Aha!
The first two are numeric, but the third is a text field.
Thanks for the pointer!

Alfred
The Battle Group
CREDO
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.31 seconds. Powered By: Snitz Forums 2000 Version 3.4.07