...

View Full Version : updating filed with ' in it



tib
09-13-2005, 06:21 PM
Hi I have a field that may have a ' in it and seeing as though it is a text field in the update statement that I am building i have

update table set field = ' " & str & " ' "

if the str variable has a ' in it the it returns an error, how can i get around this, thanks for any input

nikkiH
09-13-2005, 07:17 PM
Did you mean to put this in the Classic ASP forum?

rrhodes
09-14-2005, 03:16 AM
If you're using ASP.NET and using its built in web controls and use CommandParameters with the SqlCommand class, this is a total non-issue.

tib
09-14-2005, 05:44 PM
I am using a datagrid with the oneditcommand and onupdatecommand, it was giving me an error where there was a ', so what i did was i replaced the ' with '' (2 single quotes) and then the sql stmt ran fin bc asp.net treats '' as a single quote in a string surrounded by double quotes. Just thought I'd share that incase anyone else is having that trouble



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum