syntax on algorithm

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • lyealain
    New Member
    • May 2007
    • 102

    syntax on algorithm

    pls help on this.. imagine i have i have 2 ways of searching data... 1 is by dropdown search and another is textbox search in page A ..either one can perform the search...

    pageB

    a="select from table
    where partnumber= '"&textboxSearc h&"' || partnumber ='"&dropDownSea rch&"' "
    set b = conn.execute(a)

    if not b.eof
    call main()

    else
    response.redire ct("confirm.asp ?res=cannotFind ")
    end if

    can that be done?? but i cant get my main()
    -------------------------------------------------------------------------------------

    i have also tried

    a="select from table
    where partnumber= '"&textboxSearc h&"' || partnumber ='"&dropDownSea rch&"' "
    set b = conn.execute(a)

    if textboxSearch ="" then
    response.write( " confirm.asp?res =blank ")

    call main()

    ** this res=blank can work for the textbox search... but when i click on the dropdown.. it always link me to the "res=blank "
  • jhardman
    Recognized Expert Specialist
    • Jan 2007
    • 3405

    #2
    what is "||" supposed to mean?

    Jared

    Comment

    • lyealain
      New Member
      • May 2007
      • 102

      #3
      Originally posted by jhardman
      what is "||" supposed to mean?

      Jared

      that is or statement

      Comment

      • jhardman
        Recognized Expert Specialist
        • Jan 2007
        • 3405

        #4
        Originally posted by lyealain
        that is or statement
        when connecting to a db you have to write in SQL (structured query language. I'm not really an expert here either, but I can get around). You should use "OR" not "||"

        try
        Code:
        a="SELECT * FROM table WHERE partnumber= '"&textboxSearch&"' OR partnumber ='"&dropDownSearch&"'"
        I tried to emphasize sql keywords by capitalizing them, but sql is not case-sensitive.

        Comment

        Working...