Wrox Programmer Forums
|
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 20th, 2004, 08:35 PM
Authorized User
 
Join Date: Aug 2004
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default Syntax Error

Can anyone tell me what wrong w/ the below code??

__________________________________________________ ______________

If Request("TopicHeader") = "true" then TopicHeader = true ELSE TopicHeader = false

    strSQL = "UPDATE [General] SET "
    strSQL = strSQL & " [TopicOrder] = '" & Request("TopicOrder") & "',"
    strSQL = strSQL & " [ForumTitle] = '" & Request("ForumTitle") & "',"
    strSQL = strSQL & " [ForumDesc] = '" & Request("ForumDesc") & "',"
    strSQL = strSQL & " [TopicHeader] = '" & Request("TopicHeader") & "',"
    strSQL = strSQL & " [NumTopics] = '" & Request("NumTopics")& "',"
    strSQL = strSQL & " [NumPosts] = '" & Request("NumPosts")& "',"
    strSQL = strSQL & " [PassWord] = '" & Request("PassWord")& "'"
    strSQL = strSQL & " WHERE [TopicID] = '" & Request("TopicID")& "'"

    Conn.Execute(strSQL)
    Response.Write strSQL

end if

 
Old October 21st, 2004, 04:07 AM
Friend of Wrox
 
Join Date: Jul 2003
Posts: 683
Thanks: 0
Thanked 1 Time in 1 Post
Default

You need to split the first line of your If statement into separate lines, otherwise the final End If has no corresponding If statement...
Code:
If Request("TopicHeader") = "true" then 
    TopicHeader = true 
ELSE 
    TopicHeader = false

    strSQL = "UPDATE [General] SET "
    strSQL = strSQL & " [TopicOrder] = '" & Request("TopicOrder") & "',"
    strSQL = strSQL & " [ForumTitle] = '" & Request("ForumTitle") & "',"
    strSQL = strSQL & " [ForumDesc] = '" & Request("ForumDesc") & "',"
    strSQL = strSQL & " [TopicHeader] = '" & Request("TopicHeader") & "',"
    strSQL = strSQL & " [NumTopics] = '" & Request("NumTopics")& "',"
    strSQL = strSQL & " [NumPosts] = '" & Request("NumPosts")& "',"
    strSQL = strSQL & " [PassWord] = '" & Request("PassWord")& "'"
    strSQL = strSQL & " WHERE [TopicID] = '" & Request("TopicID")& "'"

    Conn.Execute(strSQL)
    Response.Write strSQL

end if
Cheers,

Chris






Similar Threads
Thread Thread Starter Forum Replies Last Post
Parse error: syntax error, unexpected T_ELSE in /h vipin k varghese BOOK: XSLT Programmer's Reference, 2nd Edition 4 September 29th, 2011 01:19 AM
Ch 4: Parse error: syntax error, unexpected T_SL hanizar77 BOOK: Beginning PHP5, Apache, and MySQL Web Development ISBN: 978-0-7645-7966-0 0 June 23rd, 2008 09:17 PM
Parse error: syntax error, unexpected T_STRING ginost7 Beginning PHP 1 November 9th, 2007 02:51 AM
VB Error: Syntax Error or Access Violation codehappy VB How-To 7 October 3rd, 2007 05:41 PM
Compile error: Syntax error: & Else without HELP Corey VB How-To 2 April 21st, 2006 03:25 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.