Incorrect syntax near '=' in SQL UPDATE st

Results 1 to 2 of 2

Thread: Incorrect syntax near '=' in SQL UPDATE st

  1. #1
    Acco Guest

    Default Incorrect syntax near '=' in SQL UPDATE st

    I&#039ve been racking my brains on this one.<BR>I have code as follows:-<BR><BR>&#039[connect to database]<BR>sql = "UDPATE accommodation SET a_active=0 WHERE a_guid=&#039" & a_guid & "&#039"<BR>response.write(sql)<BR>conn.execute sql<BR>&#039[disconnect from database]<BR><BR>The response.write gives me this:-<BR><BR>UDPATE accommodation SET a_active=0 WHERE a_guid=&#039{AC7E535E-B181-11D4-813E-0080C8F79304}&#039<BR><BR>The error is this (triggered on the conn.execute line):-<BR><BR>Microsoft OLE DB Provider for ODBC Drivers error &#039 80040e14&#039 <BR>[Microsoft][ODBC SQL Server Driver][SQL Server]Line 1: Incorrect syntax near &#039=&#039. <BR><BR>I know the connection (to SQL server 7) is valid and open because I&#039ve run different SQL on this page, updating different tables, which has worked. a_active is a bit field and a_guid is a char(38).<BR><BR>I&#039ve looked through the last 3 months on this board but couldn&#039t find anything. Is it a corrupt table? Is it access rights related? I don&#039t think it&#039s a reserved words issue because I&#039ve tried square-bracketing every name to no avail. Any thoughts much appreciated - it&#039s driving me loopy.<BR>

  2. #2
    Acco Guest

    Default RE: OK, forget it - I just saw the typo!

    Sorry guys - <BR>Update is of course spelled UPDATE not UDPATE....<BR>I&#039ll get my coat.<BR>

Posting Permissions

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