JacobTechy
Programmer
I have a textarea box named textarea in a form called NewsText. I am trying to update my sql server db called db1.
The table name is newstble and the column is news. I need to update the news record with what the user inputs into the textarea box but I cannot seem to get the syntax correct for the query.
I get this compilation error
Error Type:
Microsoft VBScript compilation (0x800A0401)
Expected end of statement
/submit.asp, line 93, column 46
oConn.Execute = "UPDATE newstble SET news ='" request.form("NewsText")
The table name is newstble and the column is news. I need to update the news record with what the user inputs into the textarea box but I cannot seem to get the syntax correct for the query.
Code:
strSQL = "SELECT * FROM newstble;"
oRS.Open strSQL, oConn,1,1
If Not oRS.EOF Then
oRS.MoveFirst
oConn.Execute = "UPDATE newstble SET news ='" request.form("NewsText")
end if
oRS.Close
oRS = Nothing
oConn = Nothing
oConn.Close
I get this compilation error
Error Type:
Microsoft VBScript compilation (0x800A0401)
Expected end of statement
/submit.asp, line 93, column 46
oConn.Execute = "UPDATE newstble SET news ='" request.form("NewsText")