Ask a Question related to ASP, Design and Development.
-
alexz #1
syntax error (missing operator) query expression
valuA = (request.form("toadd"))
If valuA = "" then
SQL = "UPDATE CourseReg SET attended='Active' WHERE ID
IN("&request.form("toadd")&")"
Set RS = MyConn.Execute(SQL)
End If
MyConn.Close
Set RS = Nothing
Set MyConn = Nothing
the error
syntax error (missing operator) query expression ID IN ()
alexz Guest
-
[microsoft][odbc microsoft access driver] syntax error (missing operator) in query expression error
I have a query I want to run using DBQwiksite siftware, which produces the syntax error (missing operator) in query expression error when... -
Syntax error (missing operator) in query expression
Hi, I have received the following error: ODBC Error Code = 37000 (Syntax error or access violation) Syntax error (missing operator) in query... -
Access: (missing operator) in query expression
Hi! I operate a database where visitors do inputs directly from the web thru a form. One field has the datatype (property?) Memo and I have not... -
Syntax error in Query Expression,
Hi everyone I have a page on my site in which i wish to display links to brochures, and i have stored an index of these links in my database. ... -
Syntax error (missing operator) in query expression'idProperty='
The following is the code, can someone please help me with the syntax please in the first line please Conn.Execute "UPDATE tblRentalProperty SET... -
Alex zurab #2
Re: syntax error (missing operator) query expression
MyConn.Open "media"
If (Request("toadd") = "") then
SQL = "UPDATE CourseReg SET attended='' WHERE ID
IN("&request.form("toadd")&")"
RESPONSE.WRITE SQL
RESPONSE.END
Set RS = MyConn.Execute(SQL)
That what i get
UPDATE CourseReg SET attended='' WHERE ID IN()
if i remove the if statement, i get
UPDATE CourseReg SET attended='' WHERE ID IN(237)
*** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
Don't just participate in USENET...get rewarded for it!
Alex zurab Guest
-
Aaron Bertrand - MVP #3
Re: syntax error (missing operator) query expression
Think about this. You're saying, "if this value is blank, put blank into> If (Request("toadd") = "") then
> SQL = "UPDATE CourseReg SET attended='' WHERE ID
> IN("&request.form("toadd")&")"
the IN clause."
Aaron Bertrand - MVP Guest
-
Ray at #4
Re: syntax error (missing operator) query expression
1. Why would you want to execute if toadd IS equal to ""? Wouldn't you
only want to do it if toadd IS NOT equal to ""?
2. You're using request("toadd") and request.form("toadd"). Perhaps you
have a querystring that isn't helping things.
3. Create a variable named sToAdd or something and use sToAdd =
Request.Form("toadd"). Then use the variable instead of constantly calling
the value from the form and/or ruquest collection.
Ray at home
"Alex zurab" <anonymous@devdex.com> wrote in message
news:eDKpo59RDHA.1804@TK2MSFTNGP11.phx.gbl...> MyConn.Open "media"
> If (Request("toadd") = "") then
> SQL = "UPDATE CourseReg SET attended='' WHERE ID
> IN("&request.form("toadd")&")"
> RESPONSE.WRITE SQL
> RESPONSE.END
> Set RS = MyConn.Execute(SQL)
>
> That what i get
> UPDATE CourseReg SET attended='' WHERE ID IN()
>
> if i remove the if statement, i get
> UPDATE CourseReg SET attended='' WHERE ID IN(237)
>
> *** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
> Don't just participate in USENET...get rewarded for it!
Ray at Guest
-
Alex zurab #5
Re: syntax error (missing operator) query expression
I tried using variable before and it didn't help.
the reason i want to execute if toadd IS equal to ""
is that the checkbox is already checked if there is a value (i.e it's
been update).
if i uncheck and resubmit i want that field to be null again
so a user can fix the record if it was sumbmitted by mistake (not my
idea but i have boses that want certain things).
This is how i did it.
Response.Write("<form action='add.asp' method=Post>")
if rs("attended") = "Active" then
Response.Write ("<input type=checkbox name=toadd value="""& rs("id")&"""
CHECKED>")
else
Response.Write ("<input type=checkbox name=toadd value="""&
rs("id")&""">")
End if
*** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
Don't just participate in USENET...get rewarded for it!
Alex zurab Guest



Reply With Quote

