Syntax error

Results 1 to 3 of 3

Thread: Syntax error

  1. #1
    Join Date
    Dec 1969

    Default Syntax error

    Hi,<BR><BR>I have a code like:<BR>Set RSDeptID = Connection.Execute ("select * from Departments where DeptID = " & Request.Form ("DeptID"))<BR><BR>DeptID is a number. When I submit, I got error message says: Syntax error (missing operator) in query expression &#039;DeptID=&#039;<BR><BR>Please help, thanks a lot!<BR>Jenny

  2. #2
    Join Date
    Dec 1969

    Default Copy/paste *ACTUAL* error msg

    OR, if *THIS* is an accurate copy/paste:<BR> Syntax error (missing operator) in query expression &#039;DeptID=&#039;<BR><BR>then that is saying you didn&#039;t supply any value for the DeptID.<BR><BR>In other words, your Request.Form("DeptID") was blank.<BR><BR>LEARN TO DEBUG:<BR><BR>&#060;%<BR>SQL = "select * from Departments where DeptID = " & Request.Form("DeptID")<BR>Response.Write "DEBUG: SQL is " & SQL & "&#060;HR&#062;"<BR><BR>Set RSDeptID = Connection.Execute( SQL )<BR>...<BR>%&#062;<BR><BR>What does that Response.Write show you? Hmmm??? Betcha you don&#039;t see any department id number in the debug output.<BR><BR>

  3. #3
    Join Date
    Dec 1969

    Default I'm convinced

    that Request.Form ("DeptID") is an empty string. You can check it by adding a <BR><BR>response.write "Debug: deptid" Request.Form ("DeptID") & "end <BR>"<BR><BR>It depends on what you done on the page that is submitted. Do you use post or get as method in the form? It should be post.

Posting Permissions

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