|
| |
|
|
wizard_oz
Posts: 140 Joined: 9/3/2004 From: Ga,USA Status: offline
|
encode in database - 6/23/2008 3:03:59
Hey, I have a problem with encoding some characters to a database. I have a simple form <textarea name="Description" rows="7" cols="50></textarea> and I would like to in sert it to a datebase. My problem is when someone write some charaters like ' it doen't insert to a database. The reason is at the code conn.Execute " UPDATE TroubleShooting SET Description='" & Description& "''" I mean I already have this symbol. Does anyone help me?
|
|
|
|
rdouglass
Posts: 9206 From: Biddeford, ME USA Status: offline
|
RE: encode in database - 6/23/2008 8:27:48
quote:
conn.Execute " UPDATE TroubleShooting SET Description='" & Description& "''" Try it this way: conn.Execute " UPDATE TroubleShooting SET Description='" & Replace(Description,"'","''") & "'" Be careful of all those " and ' on there. The last bold section goes: comma, double, single, double, comma, double, single, single, double What you're doing is replacing every single apostrophe with a pair of apostrophes. That'll write a single apostrophe to the DB. Hope it helps.
_____________________________
Don't take you're eye off your final destination. ASP Checkbox Function Tutorial.
|
|
|
|
wizard_oz
Posts: 140 Joined: 9/3/2004 From: Ga,USA Status: offline
|
RE: encode in database - 6/23/2008 8:46:58
Thanks It is W O K I N G !!!!!
|
|
New Messages |
No New Messages |
Hot Topic w/ New Messages |
Hot Topic w/o New Messages |
Locked w/ New Messages |
Locked w/o New Messages |
|
Post New Thread
Reply to Message
Post New Poll
Submit Vote
Delete My Own Post
Delete My Own Thread
Rate Posts
|
|
|