What happens if the Comments field is either empty or contains an apostrophe? It may be best if you handled this before the SQL statement, ditto with the ID field.
Malc www.dragondrop.com -----Original Message----- From: Hohimer, Christopher J [mailto:[EMAIL PROTECTED]] Sent: 12 August 2002 16:25 To: ActiveServerPages Subject: RE: Sending email from asp Can someone help me with an SQL error? I get the following error: Microsoft VBScript compilation error '800a0400' Expected statement When using this code: set UpdateConn = Server.CreateObject("ADODB.Connection") MdbFilePath = Server.MapPath("NWIS.mdb") UpdateConn.Open "Driver={Microsoft Access Driver (*.mdb)}; DBQ=" & MdbFilePath & ";" sqlstr = "update NWISUpdate set RequestStatus = 'Complete', Comments = '" & request.form("Comments") & "' where ID='" & request.form("id") & "'" UpdateConn.Execute(sqlstr) UpdateConn.Close set UpdateConn = nothing any help is appreciated. Thanks! --- You are currently subscribed to activeserverpages as: [EMAIL PROTECTED] To unsubscribe send a blank email to %%email.unsub%% --- You are currently subscribed to activeserverpages as: [email protected] To unsubscribe send a blank email to [EMAIL PROTECTED]
