How to insert ' in a db?

T

tshrbhag

I'm developing a web site related to properties and expect people to
insert texts like below



17' feet bed1 & 19'feet bath



I get an error when i use insert into. when the text does not contain '
and & then it inserts well.



I also tried using



rs.open "tbHomes", rsConn, adOpenDynamic, adLockOptimistic

rs.addnew

rs("blah") = blah

rs.update



but it says something about the object not supporting this method



can anyone help me soon ?



Richie
 
R

Ronny Ong

The code you show below would solve your problem with ' characters but you
are not opening your RecordSet properly. You need to review the value of
rsConn (which should not really be named rsConn in the first place, because
it should either be a string value or a connection object, not a RecordSet
itself) as well as your other ADO options, in relation to the attributes of
your "tbHomes" (name would imply that it's a table, but given that your
rsConn is misnamed, I don't want to assume that tbHomes isn't a stored
procedure, view, or other database object)
 
Top