Help with form results in query

Discussion in 'ASP General' started by Ken, Sep 29, 2003.

  1. Ken

    Ken Guest

    How can I get this line to work? I am trying to get the results entered in a
    form to be part of my query. I am able to get the form results but I get a
    error stating Syntax error (missing operator) in query expression 'Assignee
    = Tom Jones'.
    Below is the line where the error occurs

    Session("dbWhere") = "Assignee = " & Request.Form("assignsearch")

    Thanks
    Ken
    Ken, Sep 29, 2003
    #1
    1. Advertising

  2. "Ken" <> wrote in message
    news:...
    > How can I get this line to work? I am trying to get the results entered in

    a
    > form to be part of my query. I am able to get the form results but I get a
    > error stating Syntax error (missing operator) in query expression

    'Assignee
    > = Tom Jones'.
    > Below is the line where the error occurs
    >
    > Session("dbWhere") = "Assignee = " & Request.Form("assignsearch")


    Session("dbWhere") = "Assignee = '" & Request.Form("assignsearch") & "'"

    --
    Tom Kaminski IIS MVP
    http://www.iistoolshed.com/ - tools, scripts, and utilities for running IIS
    http://mvp.support.microsoft.com/
    http://www.microsoft.com/windowsserver2003/community/centers/iis/
    Tom Kaminski [MVP], Sep 29, 2003
    #2
    1. Advertising

  3. Ken

    Ken Guest

    Now this is giving me problems. Is this the correct way ?
    Session("dbWhere") = "Assignee = '" & Request.Form("assignsearch") & "'" or
    "Add_Assignees = '" & Request.Form("assignsearch") & "'"


    "Tom Kaminski [MVP]" <tomk (A@T) mvps (D.O.T) org> wrote in message
    news:bl9n9q$...
    > "Ken" <> wrote in message
    > news:...
    > > How can I get this line to work? I am trying to get the results entered

    in
    > a
    > > form to be part of my query. I am able to get the form results but I get

    a
    > > error stating Syntax error (missing operator) in query expression

    > 'Assignee
    > > = Tom Jones'.
    > > Below is the line where the error occurs
    > >
    > > Session("dbWhere") = "Assignee = " & Request.Form("assignsearch")

    >
    > Session("dbWhere") = "Assignee = '" & Request.Form("assignsearch") & "'"
    >
    > --
    > Tom Kaminski IIS MVP
    > http://www.iistoolshed.com/ - tools, scripts, and utilities for running

    IIS
    > http://mvp.support.microsoft.com/
    > http://www.microsoft.com/windowsserver2003/community/centers/iis/
    >
    >
    >
    Ken, Sep 29, 2003
    #3
  4. You can't use an "or" like that. You can't assign a value to a
    Session variable with an "or". You can use an
    "if...or...then...else" when testing for a current value, but you
    haven't made it clear what you are trying to do. Let use know what you
    are *really* trying to do,...you may have to change your whole
    approach.

    --

    Phillip Windell [CCNA, MVP, MCP]

    WAND-TV (ABC Affiliate)
    www.wandtv.com

    "Ken" <> wrote in message
    news:...
    > Now this is giving me problems. Is this the correct way ?
    > Session("dbWhere") = "Assignee = '" & Request.Form("assignsearch") &

    "'" or
    > "Add_Assignees = '" & Request.Form("assignsearch") & "'"
    Phillip Windell, Sep 29, 2003
    #4
  5. Ken

    Bob Barrows Guest

    Ken wrote:
    > How can I get this line to work? I am trying to get the results
    > entered in a form to be part of my query. I am able to get the form
    > results but I get a error stating Syntax error (missing operator) in
    > query expression 'Assignee = Tom Jones'.
    > Below is the line where the error occurs
    >
    > Session("dbWhere") = "Assignee = " & Request.Form("assignsearch")
    >

    Whenever you have this type of error, use response.write to see the results
    of your concatenation. You have no hope of troubleshooting this just by
    looking at the code. You need to see the result.

    Bob Barrows
    Bob Barrows, Sep 29, 2003
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Monique Y. Mudama
    Replies:
    1
    Views:
    440
    Monique Y. Mudama
    Jun 28, 2005
  2. lovecreatesbeauty
    Replies:
    8
    Views:
    1,624
    Old Wolf
    Sep 12, 2005
  3. Eric Nelson
    Replies:
    5
    Views:
    1,497
    Alexey Smirnov
    Feb 4, 2009
  4. IluDeR
    Replies:
    0
    Views:
    231
    IluDeR
    Jan 21, 2004
  5. IluDeR
    Replies:
    0
    Views:
    224
    IluDeR
    Jan 21, 2004
Loading...

Share This Page