navigation
a webmaster learning community
     Home    Register     Search      Help      Login    
Sponsors

Shopping Cart Software
Ecommerce software integrated into Frontpage, Dreamweaver and Golive templates. No monthly fees and available in ASP and PHP versions.

Website Templates
We also have a wide selection of Dreamweaver, Expression Web and Frontpage templates as well as webmaster tools and CSS layouts.

Frontpage website templates
Creative Website Templates for FrontPage, Dreamweaver, Flash, SwishMax

Search Forums
 

Advanced search
Recent Posts

 Todays Posts
 Most Active posts
 Posts since last visit
 My Recent Posts
 Mark posts read

Microsoft MVP

 

encode in database

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
Printable Version 

All Forums >> Web Development >> ASP and Database >> encode in database
Page: [1]
 
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.

(in reply to wizard_oz)
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 !!!!!

(in reply to rdouglass)
Page:   [1]

All Forums >> Web Development >> ASP and Database >> encode in database
Page: [1]
Jump to: 1





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