www.webdeveloper.com
Results 1 to 3 of 3

Thread: SQL Syntax Question

  1. #1
    Join Date
    Jul 2007
    Posts
    461

    SQL Syntax Question

    Hi I keep getting this error:

    Microsoft OLE DB Provider for ODBC Drivers error '80040e14'

    [Microsoft][ODBC Microsoft Access Driver] Syntax error in string in query expression '" WHERE id=229'.

    My SQL statement is as follows:

    SQL = "UPDATE Table SET Field1 = "", Field2 = "", Field3 = "" WHERE id="&id

    ID is an autonumber field and I was under the impression until now that was syntax.


    Thanks!
    Last edited by theflyingminst; 03-16-2009 at 10:45 AM.

  2. #2
    Join Date
    Aug 2006
    Location
    Michigan
    Posts
    1,046
    What language are you using in your application? PHP, ASP?

    In the blank "" in the code do you supply data?
    Code:
    SQL = "UPDATE Table SET Field1 = "", Field2 = "", Field3 = "" WHERE id="&id

  3. #3
    Join Date
    Feb 2008
    Posts
    1,666
    Perhaps you mean this? ...to set those three fields to zero-length string values?
    Code:
    SQL = "UPDATE Table SET Field1 = '', Field2 = '', Field3 = '' WHERE id = " & id & ";"
    Use double quotes to enclose the query string and single quotes to enclose string values within the query.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles