www.webdeveloper.com
Results 1 to 4 of 4

Thread: Syntax error in query. Incomplete query clause.

  1. #1
    Join Date
    Apr 2006
    Posts
    22

    resolved [RESOLVED]Syntax error in query. Incomplete query clause.

    I have created a page that manages permissions for users, letting them access, or not access, certain pages within the site depending on the permissions. I tried to adapt this page into a self-customization page in which users can block their own access to pages that they just don't want to have muddling up their interface. The original page works perfectly, however, in removing a few of the fields for this seperate page, it throws the following error:

    Microsoft JET Database Engine error '80040e14'
    Syntax error in query. Incomplete query clause.
    /Pages/customize.asp, line 177

    The code which is updating the database is here:

    PHP Code:
    sql="UPDATE security SET "
        
    sql=sql "home="
        
    if Request.Form("home")<>"" Then sql=sql "True" Else sql=sql "False" End If
        
    sql=sql ",engineering="
        
    if Request.Form("engineering")<>"" Then sql=sql "True" Else sql=sql "False" End If
        
    sql=sql ",drafting="
        
    if Request.Form("drafting")<>"" Then sql=sql "True" Else sql=sql "False" End If
        
    sql=sql ",charts="
        
    if Request.Form("charts")<>"" Then sql=sql "True" Else sql=sql "False" End If
        
    sql=sql ",office="
        
    if Request.Form("office")<>"" Then sql=sql "True" Else sql=sql "False" End If
        
    sql=sql ",catalogs="
        
    if Request.Form("catalogs")<>"" Then sql=sql "True" Else sql=sql "False" End If
        
    sql=sql ",bddl="
        
    if Request.Form("bddl")<>"" Then sql=sql "True" Else sql=sql "False" End If
        
    sql=sql ",trussstatus="
        
    if Request.Form("trussstatus")<>"" Then sql=sql "True" Else sql=sql "False" End If
        
    sql=sql ",key_dtl="
        
    if Request.Form("keyanddtl")<>"" Then sql=sql "True" Else sql=sql "False" End If
        
    sql=sql ",sw_hd="
        
    if Request.Form("sw_hd")<>"" Then sql=sql "True" Else sql=sql "False" End If
        
    sql=sql ",sheetindex="
        
    if Request.Form("sheetindex")<>"" Then sql=sql "True" Else sql=sql "False" End If
        
    sql=sql ",porch="
        
    if Request.Form("porch")<>"" Then sql=sql "True" Else sql=sql "False" End If
        
    sql=sql ",draftdeskref="
        
    if Request.Form("draftingdeskref")<>"" Then sql=sql "True" Else sql=sql "False" End If
        
    sql=sql ",repro="
        
    if Request.Form("repro")<>"" Then sql=sql "True" Else sql=sql "False" End If
        
    sql=sql ",draftstand="
        
    if Request.Form("draftstandard")<>"" Then sql=sql "True" Else sql=sql "False" End If
        
    sql=sql ",adtinfo="
        
    if Request.Form("adtinfo")<>"" Then sql=sql "True" Else sql=sql "False" End If
        
    sql=sql ",strip="
        
    if Request.Form("strip")<>"" Then sql=sql "True" Else sql=sql "False" End If
        
    sql=sql ",specialchars="
        
    if Request.Form("specialchars")<>"" Then sql=sql "True" Else sql=sql "False" End If
        
    sql=sql ",plot_pub="
        
    if Request.Form("plotandpub")<>"" Then sql=sql "True" Else sql=sql "False" End If
        
    sql=sql " WHERE user='" xuser "'"
        
    adoCon.Execute sql '**LINE 177** 
    if I replace the execute line with a response.write(sql) the statement looks fine to me...

    UPDATE security SET home=True,engineering=True,drafting=True,charts=True,office=True,catalogs=True,bddl=True,trussstatus =True,key_dtl=True,sw_hd=True,sheetindex=True,porch=True,draftdeskref=True,repro=True,draftstand=Tru e,adtinfo=True,strip=True,specialchars=True,plot_pub=True WHERE user='Gcronin'

    Thanks in advance!
    -Greg
    Last edited by GDawgGWC; 04-28-2006 at 01:56 PM.

  2. #2
    Join Date
    Jun 2004
    Location
    Kansas City, MO
    Posts
    1,607
    well in the query provided i see this

    draftstand=Tru e,

    which should through an error if say the data type is bit.

    Aslo take you statement and execute it query analyser (if you use sql server 2000) and this will provide an error that might be more helpful

  3. #3
    Join Date
    Apr 2006
    Posts
    22
    Thanks for that. The space in "Tru e" doesn't show up on the page, must've been an accidental space in the post. As far as the database, it's MSAccess, and I don't have much access to the server as it's a remote web host.

  4. #4
    Join Date
    Apr 2006
    Posts
    22

    Red face

    Whoops. Second time I've done this, the page was cached, when I Ctrl-Refreshed it, it came up fine. Sorry for the trouble.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles