Wrox Programmer Forums
|
ASP Forms As of Oct 5, 2005, this forum is now locked. Please use "Classic ASP beginner" at http://p2p.wrox.com/forum.asp?FORUM_ID=54 or "Classic ASP Professional" http://p2p.wrox.com/forum.asp?FORUM_ID=56 instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP Forms 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 December 27th, 2004, 09:20 AM
Registered User
 
Join Date: Dec 2004
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default Weird syntax error in my asp code?

i got the following code:

<%
    Dim Connection
    Dim Recordset
    Dim SQL
    Dim geregistreerdcheck
    Dim admincheck

    Set Recordset = Server.CreateObject("ADODB.Recordset")
    Set Connection = Server.CreateObject("ADODB.Connection")

        If Request.form("edtadmin") = "True" Then admincheck = 1
Else admincheck = 0
end if

geregistreerdcheck = 1

        Call Connection.Open("DRIVER={Microsoft Access Driver (*.mdb)};" & _
            "DBQ=" & Server.MapPath("HelpdeskI&A.mdb"))


    SQL = "INSERT INTO tbl_klanten(username, geregistreerd, admin, password) VALUES ('" _

     & Request ("edtusername") & "','" _
     & (geregistreerdcheck) & "','" _
     & (admincheck) & "','" _
     & Request ("edtpassword") & "')"

   Call Recordset.Open(SQL, Connection)

%>

i get the following error:

Syntaxerror
/Website/beheer_gebruiker_toevoegen.asp, line 16
Else admincheck = 0

whats wrong? :/

 
Old December 27th, 2004, 09:57 AM
Registered User
 
Join Date: Dec 2004
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi,

U may have double quote in values which ur getting from the page...

Check the values .....




Satish Kumar J
 
Old December 27th, 2004, 11:05 AM
Registered User
 
Join Date: Dec 2004
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

what do u mean by double quotes?
i just got a checkbox which u can check or not check :o

 
Old December 27th, 2004, 12:32 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi zwanz,

You should put each If and Else block on separate lines:
Code:
If Request.form("edtadmin") = "True" Then 
  admincheck = 1
Else 
  admincheck = 0
End If
Cheers,

Imar
 
Old December 28th, 2004, 03:50 AM
Registered User
 
Join Date: Dec 2004
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

dank u ;)

 
Old December 28th, 2004, 05:23 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Graag gedaan ;)

Alvast een Gelukkig Nieuw Jaar!!


Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Syntax error in FROM clause: asp jpindi ASP.NET 1.0 and 1.1 Basics 6 July 16th, 2008 12:30 AM
asp help for newbie syntax error jennypretty Classic ASP Basics 2 June 1st, 2007 01:08 PM
Weird Syntax Error mjhoagland Classic ASP Professional 3 May 5th, 2007 04:25 AM
ASP.NEt syntax error crmpicco ASP.NET 2.0 Basics 5 December 7th, 2006 12:54 PM
Syntax error for chapter 15 AddUser.asp gymmic Classic ASP Databases 7 April 20th, 2004 02:00 AM





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