Results 1 to 12 of 12
  1. #1
    Join Date
    Aug 2004
    Posts
    13

    Angry Unanswered: Whats wrong with this?

    <%
    dim A
    dim B
    dim C
    dim D
    dim E
    dim F
    dim G
    dim H
    dim strdbpath
    A = Request.Form("Number")
    B = Request.Form("Nickname")
    C = Request.Form("Description")
    D = Request.Form("Category")
    E = Request.Form("AskingPrice")
    F = Request.Form("Condition")
    G = Request.Form("Sold")
    H = Request.Form("OrigID")
    strDBPath = Server.MapPath("main_processing.mdb")
    Set oConn2 = Server.CreateObject("ADODB.Connection")
    oConn2.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & strDBPath & ";"
    oConn2.Execute ("UPDATE Results SET Number = '222', Nickname = '2222', Description = '22222', Category = '22222', AskingPrice = '2222', Condition = '22222', Sold = '22222' WHERE ID = 2")
    %>

    This is my code, I always get a "SYNTAX ERROR IN UPDATE QUERY" can somebody please help?

    Thanks so much...
    Last edited by JPry565; 08-13-04 at 15:58. Reason: Forgot to say thanks.

  2. #2
    Join Date
    Jul 2003
    Location
    SoCal
    Posts
    721
    Try it without the parenthesis:

    oConn2.Execute "UPDATE Results SET Number = '222', Nickname = '2222', Description = '22222', Category = '22222', AskingPrice = '2222', Condition = '22222', Sold = '22222' WHERE ID = 2"
    That which does not kill me postpones the inevitable.

  3. #3
    Join Date
    Aug 2004
    Posts
    13

    Unhappy Still dosen't work.

    Microsoft JET Database Engine error '80040e14'

    Syntax error in UPDATE statement.

    /Desk01/dym3.asp, line 58

    I'm still getting this error, I'm sure that my SYNTAX is right.

    Please Help.

    Thanks.

  4. #4
    Join Date
    Jul 2003
    Location
    SoCal
    Posts
    721
    Are all of your columns text columns?
    That which does not kill me postpones the inevitable.

  5. #5
    Join Date
    Mar 2003
    Location
    Atlanta, GA
    Posts
    191
    This error sometimes is caused by a table name or field name that is a reserved word. I'm not fully aware of all the reserved words, but to see if this is the cause, try renaming your table and fields and see if that makes any difference. I would start by renaming the table first.

    Tim
    Tim

  6. #6
    Join Date
    Jul 2003
    Location
    SoCal
    Posts
    721
    Quote Originally Posted by MrWizard
    This error sometimes is caused by a table name or field name that is a reserved word. I'm not fully aware of all the reserved words, but to see if this is the cause, try renaming your table and fields and see if that makes any difference. I would start by renaming the table first.
    That's a good point. You can put your tables and columns in brackets [ ] to tell the interpreter not to use them as keywords:

    UPDATE [Results] SET [Number] = '222', [Nickname] = '2222', [Description] = '22222', [Category] = '22222', [AskingPrice] = '2222', [Condition] = '22222', [Sold] = '22222' WHERE [ID] = 2
    That which does not kill me postpones the inevitable.

  7. #7
    Join Date
    Aug 2004
    Posts
    13

    I'll give that a try

    I'll give that a try

    Thanks

  8. #8
    Join Date
    Aug 2004
    Posts
    13
    It ocassionally works, it says operation must use an updatable query?

  9. #9
    Join Date
    Aug 2004
    Posts
    13
    Can somebody please help me?

  10. #10
    Join Date
    Aug 2004
    Posts
    13
    MOD EDIT: No need for the abuse. You have been warned.
    Last edited by JonathanB; 08-22-04 at 08:09.

  11. #11
    Join Date
    Nov 2003
    Location
    Christchurch, New Zealand
    Posts
    1,618
    If it is working sometimes and not working at others I would suggest it has something to do witht eh state of the database or any locks you might have on the tables or the particular record.

    Can you give us any idea when it works and when it doesn't work?

    At a guess I would say this would fail if the table was open in Access or if you were viewing the record in Access, but should work at all other times.

  12. #12
    Join Date
    Jul 2003
    Location
    SoCal
    Posts
    721
    Access is finicky. Since it was not designed to be a high performance DB, it often has problems with multiple insert/updates that occur simultaneously.
    That which does not kill me postpones the inevitable.

Posting Permissions

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