Ask a Question related to ASP Database, Design and Development.

  1. #1

    Default SQL Syntax Error

    Having some problems with my SQL statement syntax:

    Microsoft JET Database Engine (0x80040E14)
    Syntax error (missing operator) in query expression
    'MealsExCode=0000104Amount=23.56'.

    Can anyone tell me what I might be doing wrong. Help apprecaited.
    Thanks:

    SQLstmt = "UPDATE Expense SET "
    SQLStmt = SQLstmt & "ExDate='" & form_ExDate & "',"
    SQLstmt = SQLstmt & "Expense=" & form_Expense
    SQLstmt = SQLstmt & "ExCode=" & form_ExCode
    SQLstmt = SQLstmt & "Amount=" & form_Amount
    SQLStmt = SQLStmt & " WHERE ExpenseID=" & form_id

    Set rstSimple = cnnSimple.Execute(SQLStmt)

    *** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
    Don't just participate in USENET...get rewarded for it!
    Frank Py Guest

  2. Similar Questions and Discussions

    1. Syntax error
      I posted a question or two on this recently, and posts have been helpful. However, I have a new problem, and don't know what to do. To recap....
    2. Help on Syntax error please
      I'm new to MySQL. Sorry for asking for some probably very basic help. :( The following code is from a Dump of a php forums database (openBB...
    3. Syntax error?
      Hi, I'm developing an ASP.NET web application with MySql 5. I have a little problem: if i create a stored procedure like this one: CREATE...
    4. error : syntax error at or near $1 for over select rows
      This is the error i am getting when calling select * from cas_reset_qi_changedate('CAS','2003-02-03' ERROR: syntax error at or near "$1" at...
    5. syntax error ???
      Hi, on login.php , we can see that : (...) $sql = "SELECT Login FROM logins WHERE Login='$fusername'"; $result = mysql_query($sql) or...
  3. #2

    Default Re: SQL Syntax Error

    "Frank Py" <fpy@proactnet.com> wrote in message
    news:e2ixqw8RDHA.1720@TK2MSFTNGP10.phx.gbl...
    > Having some problems with my SQL statement syntax:
    >
    > Microsoft JET Database Engine (0x80040E14)
    > Syntax error (missing operator) in query expression
    > 'MealsExCode=0000104Amount=23.56'.
    >
    > Can anyone tell me what I might be doing wrong. Help apprecaited.
    > Thanks:
    >
    > SQLstmt = "UPDATE Expense SET "
    > SQLStmt = SQLstmt & "ExDate='" & form_ExDate & "',"
    > SQLstmt = SQLstmt & "Expense=" & form_Expense
    > SQLstmt = SQLstmt & "ExCode=" & form_ExCode
    > SQLstmt = SQLstmt & "Amount=" & form_Amount
    > SQLStmt = SQLStmt & " WHERE ExpenseID=" & form_id
    >
    > Set rstSimple = cnnSimple.Execute(SQLStmt)
    >
    > *** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
    > Don't just participate in USENET...get rewarded for it!
    You're missing the comma between your field assignment clauses. You did
    it for the first one but not the others. In the future, when you
    encounter an error, you should "Response.Write SQLStmt", copy the
    outputted SQL statement and paste into the Access Query Builder/SQL
    Server Query Analyzer depending on your database platform. This will
    give you more details on the errors the SQL parser is encountering.
    Also, when posting a database related issue please include your database
    platform and version. I would also suggest you consider using a stored
    procedure or a parameterized query for this update, again depending on
    your database platform.

    HTH
    -Chris


    Chris Hohmann Guest

  4. #3

    Default Re: SQL Syntax Error

    That helped with all my syntax errors. Thanks.

    Sincerley,
    Frank



    *** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
    Don't just participate in USENET...get rewarded for it!
    Frank Py Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139