Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_databases thread: Input text with ' cannot be inserted into a ACCESS DB


Message #1 by Gui You <guiyou01@y...> on Sun, 9 Feb 2003 21:05:38 -0800 (PST)
Hi all,

A ASP script needs to insert the inputted text into a ACCESS DB, but if inputted text with ' ( e.g, I don't know, I can't, ......),
then it cannot be inserted into the database. Please help me. Thanks.

YoYo



---------------------------------
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now
Message #2 by Bimal Panda <bimal@o...> on Sun, 9 Feb 2003 21:32:00 -0800 (PST)
open a recordset and add records. you will not face this problem.otherwise use replace function to
replace the '.

Example :

Set RS = Server.CreateObject("ADODB.Recordset")
RS.Open "Franchise_login_details",conn,adopenstatic,adlockoptimistic
RS.AddNew
RS("Franchise_Id")=Franchise_Id
RS("Fran_login")=Fran_login

RS.Update
RS.Close
set RS=nothing



--- Gui You <guiyou01@y...> wrote:
>
>Hi all,
>
>A ASP script needs to insert the inputted text into a ACCESS DB, but if inputted text with ' ( e.g, I don't know, I can't,
......), then it cannot be inserted into the database. Please help me. Thanks.
>
>YoYo
>
>
>
>---------------------------------
>Do you Yahoo!?
>Yahoo! Mail Plus - Powerful. Affordable. Sign up now
>

_____________________________________________________________
http://www.on-lyne.com - Seamless Solutions Across Borders !!

_____________________________________________________________
Select your own custom email address for FREE! Get you@y... w/No Ads, 6MB, POP & more!
http://www.everyone.net/selectmail?campaign=tag
Message #3 by "Paul Douglas" <pdouglas@t...> on Mon, 10 Feb 2003 17:01:18 +1100
Hi Gui,
Just use something like :

Replace(Request.Form("frmComment"),"'","''")

This will replace one single quote with two which is interpreted 
properly by SQL....
Cheers
Paul

-----Original Message-----
From: Gui You [mailto:guiyou01@y...]
Sent: Monday, 10 February 2003 4:06 PM
To: ASP Databases
Subject: [asp_databases] Input text with ' cannot be inserted into a
ACCESS DB



Hi all,

A ASP script needs to insert the inputted text into a ACCESS DB, but if 
inputted text with ' ( e.g, I don't know, I can't, ......), then it 
cannot be inserted into the database. Please help me. Thanks.

YoYo



---------------------------------
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now


  Return to Index