Getting an error saying syntax error (missing operator) in query expression

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sushma somesh
    New Member
    • May 2014
    • 1

    Getting an error saying syntax error (missing operator) in query expression

    HI,
    my code for search is
    rec.Open "select * from Body_Markings_n ew where Part Number like '%" & txtsearch.Text & "%' ", conn, adOpenDynamic, adLockOptimisti c

    after compiling this code getting an error saying syntax error (missing operator) in query expression 'part number like' %1%"

    please help me I not able to fix this.
  • Rabbit
    Recognized Expert MVP
    • Jan 2007
    • 12517

    #2
    You should avoid spaces in object names. If you're going to use them, then you have to tell the SQL that the two separate words are one thing but demarcating them as such. That will depend on which DBMS you're using. In SQL Server, you use square brackets [ ]. In MySQL, you use ticks ` `.

    Comment

    Working...