Results 1 to 3 of 3

Thread: update sql

  1. #1
    Join Date
    Feb 2008
    Posts
    120

    Unanswered: update sql

    hi all....
    i'm not sure if this should be in the forum or the SQl Server forum, but here goes.

    I'm trying to update multiple records using code i found on 'webthang'.
    My update code is:

    Code:
    updateSQL = "UPDATE OrderDetails SET InStock=" & fFormat(Request(cInStock)) & "WHERE OrderDetailID=" & fFormat(Request(cRecordID))
    but i'm getting this error!

    Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
    [Microsoft][ODBC SQL Server Driver][SQL Server]Incorrect syntax near 'OrderDetailID'.

    Can anyone see where the problem is?
    Thanks guys
    Andy

  2. #2
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    almost certainly missing punctuation
    Code:
    updateSQL = "UPDATE OrderDetails SET InStock=" & fFormat(Request(cInStock)) & " WHERE
    if the colun is text values must be quoted
    eg
    where MyTextColumn = 'a text value'
    I'd rather be riding on the Tiger 800 or the Norton

  3. #3
    Join Date
    Feb 2008
    Posts
    120
    fixed!

    Code:
    UPDATE OrderDetails SET InStock='" & fFormat(Request.Form(cInStock)) & "'"  & " WHERE OrderDetailID=" & fFormat(Request.Form(cRecordID))
    Thanks healdem :-D

Posting Permissions

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