|
Loert -> RE: Syntax Error: Update SQL Statement in ASP (8/20/2003 12:58:15)
|
Ok. I think I'm making some progress. I'm now getting the following: "Incorrect syntax near 'T_SALE_TRCK_FORM'. " Thanks for the tip rdouglass, you were right with the STF_ID being a number. I've added the following to the where clause: "mySQL &" so when I run the response.write, I can see the SQL statement in its entirety: UPDATE DISTINCTROW [T_SALE_TRCK_FORM] SET ( BIZ_OTHR_PROD2_TXT, BIZ_OTHR_PROD_TXT, RQST_CLOS_FLG ) VALUES ('UGRL41','First.Last@somecompany.com','') WHERE STF_ID = 1 Here is the code as it stands now: Dim myConnString Dim myConnection Dim mySQL myConnString = Application("TELEBANKPRODUCTION_ConnectionString") Set myConnection = Server.CreateObject("ADODB.Connection") myConnection.Open myConnString mySQL = " UPDATE DISTINCTROW T_SALE_TRCK_FORM " mySQL = mySQL & "SET ( BIZ_OTHR_PROD2_TXT, BIZ_OTHR_PROD_TXT, RQST_CLOS_FLG ) " mySQL= mySQL & "VALUES ('" & Request.Form("BIZ_OTHR_PROD2_TXT") & "','" & Request.Form("BIZ_OTHR_PROD_TXT") & "','" & Request.Form("RQST_CLOS_FLG") & "')" mySQL= mySQL & " WHERE STF_ID = " & Request.Form("STF_ID") myConnection.Execute mySQL myConnection.Close When I run this code, I get a new syntax error referring to the table itself: Incorrect syntax near 'T_SALE_TRCK_FORM'. Then I add the response.write to see the string. This is puzzeling. It's almost if I don't have rights to update the database. I'll follow up with the DBA. Any other thoughts guys?
|
|
|
|