Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Aug 2011
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    syntax error update statement

    hi all this is my first post and im new here.
    my question is i get this error;

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

    [Microsoft][ODBC Microsoft Access Driver] Syntax error in UPDATE statement.

    /testmap/xml/paycheck.asp, line 36


    -----------------------------------------------------
    and here is the code of this error;

    <%
    var1 = Replace(Request("var1"),"'","&#96;")
    var2 = Replace(Request("var2"),"'","&#96;")
    var3 = Replace(Request("var3"),"'","&#96;")
    var4 = Replace(Request("var4"),"'","&#96;")

    connect2="DSN=fee;UID=dogan ;PWD=besiktas"

    set rs1=Server.CreateObject("ADODB.Recordset")

    Set xml = Server.CreateObject("Microsoft.XMLHTTP")

    xurl="http://www.mollie.nl/xml/micropayment/?a=check&servicenumber=" & var1 & "&paycode=" & var2

    xml.Open "GET", xurl, False

    xml.Send ""

    HTTPReturnCode = xml.status

    x_Result = xml.ResponseText

    stringc1 = InStr(x_Result,"<payed>")
    stringc2 = InStr(x_Result,"</payed>")

    stringc1 = stringc1 + len("<payed>")

    stringc2 = stringc2 - stringc1

    payed = Mid(x_Result,stringc1,stringc2)

    if payed = "false" then

    sql_update1 = " Update UYELER SET BAKIYE ='1', WHERE id = '" & var3 & "';"

    rs1.open sql_update1, connect2, 1,3

    Response.write "false"

    if var4 = "noajax" then

    Response.redirect("../plus.asp?aktie=m6")

    end if

    elseif payed = "true" then

    'True doorgeven aan AJAX request

    Response.write "true"

    if var4 = "noajax" then

    Response.redirect("../plus.asp?aktie=m5")

    end if
    end if

    %>


    so where is error i cant see pls help

  • #2
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    25,155
    Thanks
    75
    Thanked 4,338 Times in 4,304 Posts
    One problem, two possible problems:

    Code:
    sql_update1 = " Update UYELER SET BAKIYE ='1', WHERE id = '" & var3 & "';"
    The guaranteed problem: The comma before WHERE is bogus. You only use a comma between multiple set name=value pairs, never after the last one.

    Possible problems:
    (1) If your BAKIYE field data type is INT then you should *NOT* put apostrophes around the 1.
    (2) If your ID field data type is INT then you should *NOT* put apostrophes around the var3 value.

    Actually, you should only use apostrophes around either of those values if the fields in question are some kind of text field: TEXT, VARCHAR, MEMO, etc. If they are any kind of number (INT or LONG or DOUBLE) then kill the apostrophes.

    USUALLY, ID fields are numbers. And since you are assigning the value 1 to BAKIYE, I would guess that it *probably* is a number, too. So *probably* you don't need or want any apostrophes in that query.

    Finally, you don't have to put a semicolon on the end of the query. You can, but it is 100% optional.

    So my *GUESS* is that all you need is this:
    Code:
    sql_update1 = "Update UYELER SET BAKIYE =1 WHERE id = " & var3
    But, again, it depends entirely on what the data types are of those fields.


  •  

    Posting Permissions

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