Asp Search SQL

Results 1 to 3 of 3

Thread: Asp Search SQL

  1. #1
    Join Date
    Dec 1969
    Posts
    247

    Default Asp Search SQL

    I need to know the correct SQL syntax for search for records from a database. This is what i have. I have a form with a textbox name firname and a submit button. I need to select the first_name, last_name of possible matches which was enter in the textbox. My SQL is unrecognizable to the server. My SQL is this....<BR> SELECT e.ID, e.Last_Name, e.First_Name FROM tblEmployee e WHERE First_Name LIKE " & firstname<BR><BR>This is the error message that i am getting.........<BR>Microsoft OLE DB Provider for ODBC Drivers error &#039 80040e14&#039 <BR><BR>[Microsoft][ODBC Microsoft Access 97 Driver] Syntax error (missing operator) in query expression &#039First_Name & alike&#039.

  2. #2
    Join Date
    Dec 1969
    Posts
    4

    Default RE: Asp Search SQL

    Try something like this:<BR><BR>SQL="SELECT ID, Last_Name, First_Name FROM tblEmployee WHERE First_Name LIKE " & "&#039" & "%" & firstname & "%" & "&#039"

  3. #3
    tabby Guest

    Default RE: Asp Search SQL

    Sorry I meant try something like this:<BR><BR>SQL="SELECT ID, Last_Name, First_Name FROM tblEmployee WHERE " SQL= SQL & "First_Name LIKE &#039" & "%" & firstname & "%" & "&#039"

Posting Permissions

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