Could you please help me remedy this error? Thank you.... Microsoft OLE DB Provider for SQL Servererror '80040e14' Line 1: Incorrect syntax near '='. /home/reactivate.asp, line 17 I believe line 17 is: MyConn.Execute uSQL <!--#include file="app_config.asp"--> <!--#include file="inc_header.asp"--> <% MType = Trim( request( "MType" ) ) IF MType = 0 THEN sMESSAGE = sMESSAGE & "<li />You did not select a valid MEMBERSHIP TYPE" %><!--#include file="inc_error.asp"--><% ELSE Call OPEN_DB() '// UPDATE USER ACCOUNT STATUS ( to Unpaid Account ) uSQL = "UPDATE mms_tbl_user " &_ "SET fldSTATUS = '" & Cstr(drpSTATUS(5)) & "' " &_ "WHERE ID = " & session( "sUSER_ID" ) [B]MyConn.Execute uSQL[/B] dSQL = "DELETE from mms_tbl_user_membershipType " &_ "WHERE fldUSER_ID = " & session( "sUSER_ID" ) MyConn.Execute dSQL cSQL = "DELETE from mms_tbl_user_cate " &_ "WHERE fldUSER_ID = " & session( "sUSER_ID" ) MyConn.Execute cSQL set cRS = MyConn.Execute( "SELECT * FROM mms_tbl_membershipType_cate WHERE fldMembershipType_ID = " & MTYPE ) while not cRS.EOF MyConn.Execute( "INSERT INTO mms_tbl_user_cate (fldCATE_ID, fldUSER_ID)" &_ "VALUES (" & cRS( "fldCATE_ID" ) & ", " & session( "sUSER_ID" ) & ")" ) cRS.MoveNext wend '// DEFINE MEMBERSHIP LEVEL ASSIGNMENT mSQL = "INSERT INTO mms_tbl_user_membershipType (fldMType_ID, fldUSER_ID)" &_ "VALUES (" & MType & ", " & session( "sUSER_ID" ) & ")" MyConn.Execute mSQL MyConn.Close Set MyConn = Nothing Session.Timeout = 25 Response.Redirect "_register_2.asp?p=" & PAYMENT & "&MType=" & MType Response.End END IF %> Code (markup):
1. Is session("sUSER_ID") a string? If so, you need to enclose it in single quotes: "WHERE ID = '" & session( "sUSER_ID" ) & "'" Code (markup): 2. Does drpSTATUS(5) contain a single quote? If so, you need to escape it by doubling it: Replace(Cstr(drpSTATUS(5)), "'", "''") Code (markup): I'm not sure if either of those is what's causing it though.
it's an sql syntax error - if you break at line 17 and look at the vale of dsql it should be obvious. If not, post it here.