update a recordset

Discussion in 'Classic ASP' started by yiouli1, Jul 12, 2004.

Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.
  1. FUNCTION fixQuotes(theString)
    fixQuotes=REPLACE(theString,"'","''")
    END FUNCTION

    if updateProduct<>"" then
    sqlString="UPDATE Products SET"&_
    "product_name='"&fixQuotes(productName)&"',"&_
    "product_price="&productPrice&","&_
    "product_picture='"&fixQuotes(productPicture)&"',"&_
    "product_category='"&fixQuotes(productCategory)&"',"&_
    "product_briefdesc='"&fixQuotes(productBriefDesc)&"',"&_
    "product_fulldesc='"&fixQuotes(productFullDesc)&"',"&_
    "product_status="&productStatus&"WHERE"&_
    "product_id="&productID

    Con.Execute sqlString -------->line 80
    end if


    I get the following error message:

    Error Type:
    Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
    [Microsoft][ODBC Microsoft Access Driver] Syntax error in UPDATE statement.
    /manageproducts.asp, line 80
     
  2. Bruce

    Bruce DiscountASP.NET Staff

    i think the problem is at this line

    sqlString="UPDATE Products SET"&_

    change it to

    sqlString="UPDATE Products SET "&_
    ^^

    if there's still a problem, try print the sqlstring out rather than executing it


    quote:Originally posted by yiouli1

    FUNCTION fixQuotes(theString)
    fixQuotes=REPLACE(theString,"'","''")
    END FUNCTION

    if updateProduct<>"" then
    sqlString="UPDATE Products SET"&_
    "product_name='"&fixQuotes(productName)&"',"&_
    "product_price="&productPrice&","&_
    "product_picture='"&fixQuotes(productPicture)&"',"&_
    "product_category='"&fixQuotes(productCategory)&"',"&_
    "product_briefdesc='"&fixQuotes(productBriefDesc)&"',"&_
    "product_fulldesc='"&fixQuotes(productFullDesc)&"',"&_
    "product_status="&productStatus&"WHERE"&_
    "product_id="&productID

    Con.Execute sqlString -------->line 80
    end if


    I get the following error message:

    Error Type:
    Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
    [Microsoft][ODBC Microsoft Access Driver] Syntax error in UPDATE statement.
    /manageproducts.asp, line 80

    </blockquote id="quote"></font id="quote">
     
Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.

Share This Page