I’m getting the following error on the line of code below:
Syntax error (missing operator) in query expression ‘REPLACE(LTRIM(RTRIM(ATTACHMENTS)), ,”)’.
Any help would be awesome…
-----------the line of code that is giving me problems-------------------------------- objConn.Execute('UPDATE EMAIL_SEND_ATTACHMENTS set ATTACHMENTS = REPLACE(LTRIM(RTRIM(ATTACHMENTS)), '& StoredPath & ' ,'') WHERE EMAIL_LETTERS_HOLD_ID= '& AttID & ' ') -----------------------full asp page being called by a function------------------ <% Dim AttID, RedirectURL Dim objConn dim StoredPath AttID=request('EMAIL_LETTERS_HOLD_ID') RedirectURL=request('RedirURL') Set objConn = CreateObject('ADODB.Connection') objConn.Open 'DSN=AccessDSN' objConn.Execute('UPDATE EMAIL_SEND_ATTACHMENTS set ATTACHMENTS = REPLACE(LTRIM(RTRIM(ATTACHMENTS)), ' & StoredPath & ' ,'') WHERE EMAIL_LETTERS_HOLD_ID= '& AttID & ' ') objConn.Close Set objConn = Nothing response.redirect RedirectURL %>
I think you’re missing some quotes – check before and after the StoredPath variable:
objConn.Execute(‘UPDATE EMAIL_SEND_ATTACHMENTS set ATTACHMENTS = REPLACE(LTRIM(RTRIM(ATTACHMENTS)), ”& StoredPath & ” ,”) WHERE EMAIL_LETTERS_HOLD_ID= ‘& AttID & ‘ ‘)
Andy.