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)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top