[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 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.
Bookmarks