Help submitting a field into a database
at the moment I have the following code, for a local email system on my Intranet:
Code:
Set objComm = Server.CreateObject("ADODB.Command")
objComm.ActiveConnection = strConnect
objComm.CommandText="INSERT INTO mail ([sender], [recipient], [subject], [message], [locked]) VALUES ('" & user & "', '" & recipient & "', '" & subject & "', '" & message & "', '1')"
objComm.Execute intNoOfRecords
Set objComm = Nothing
However if a user includes a ' into their message they get an error message as the sql statement thinks it is moving on to fill the next feild.
How can I make the message variable submit regardless of any character that I put in to it (including ' )
Thankyou
|