|
 |
asp_databases thread: Handle single quote in form data with SQL 7 as backend
Message #1 by "Bernie Hsu" <bhsu606@h...> on Mon, 18 Dec 2000 09:11:08 -0000
|
|
Is there a way to handle inputting single quotes into the address field of
a form which will be posted to SQL Server 7 table using the T-SQL INSERT?
For example, if the address contains
113 Queen's Road
When I tried to paste together the string, the single quote gave me the
problem as SQL thinks this is the end of the input string
values (....,'113 Queen's Road',.......)
Thanks.
---
FREE WEB DEVELOPMENT CODE, CONTENT, AND INSIGHTS
IN YOUR INBOX!
Get the latest and best HTML, XML, and JavaScript tips, tools, and
developments from the experts. Sign up for one or more of EarthWeb's
FREE IT newsletters at http://www.earthweb.com today!
---
You are currently subscribed to asp_databases as: $subst('Recip.EmailAddr')
To unsubscribe send a blank email to leave-asp_databases-$subst('Recip.MemberIDChar')@p2p.wrox.com
Message #2 by Arun Venkatesh Kumar <arun_vk@t...> on Mon, 18 Dec 2000 15:47:23 +0530
|
|
replace the "'" with two "'".
ex: values (....,'113 Queen''s Road',.......)
the continuous "''" will be treated as "'".
regards,
arun
-----Original Message-----
From: Bernie Hsu [mailto:bhsu606@h...]
Sent: Monday, December 18, 2000 2:41 PM
To: ASP Databases
Subject: [asp_databases] Handle single quote in form data with SQL 7 as
backend
Is there a way to handle inputting single quotes into the address field of
a form which will be posted to SQL Server 7 table using the T-SQL INSERT?
For example, if the address contains
113 Queen's Road
When I tried to paste together the string, the single quote gave me the
problem as SQL thinks this is the end of the input string
values (....,'113 Queen's Road',.......)
Thanks.
---
FREE WEB DEVELOPMENT CODE, CONTENT, AND INSIGHTS
IN YOUR INBOX!
Get the latest and best HTML, XML, and JavaScript tips, tools, and
developments from the experts. Sign up for one or more of EarthWeb's
FREE IT newsletters at http://www.earthweb.com today!
---
You are currently subscribed to asp_databases as: $subst('Recip.EmailAddr')
To unsubscribe send a blank email to leave-asp_databases-$subst('Recip.MemberIDChar')@p2p.wrox.com
Message #3 by "Dallas Martin" <dmartin@z...> on Mon, 18 Dec 2000 20:28:12 -0500
|
|
you need to do this with your text string
SomeText = replace(SomeText,"'","''")
hth,
Dallas Martin
----- Original Message -----
From: "Bernie Hsu" <bhsu606@h...>
To: "ASP Databases" <asp_databases@p...>
Sent: Monday, December 18, 2000 4:11 AM
Subject: [asp_databases] Handle single quote in form data with SQL 7 as
backend
> Is there a way to handle inputting single quotes into the address field of
> a form which will be posted to SQL Server 7 table using the T-SQL INSERT?
>
> For example, if the address contains
>
> 113 Queen's Road
>
> When I tried to paste together the string, the single quote gave me the
> problem as SQL thinks this is the end of the input string
>
> values (....,'113 Queen's Road',.......)
>
> Thanks.
---
FREE WEB DEVELOPMENT CODE, CONTENT, AND INSIGHTS
IN YOUR INBOX!
Get the latest and best HTML, XML, and JavaScript tips, tools, and
developments from the experts. Sign up for one or more of EarthWeb's
FREE IT newsletters at http://www.earthweb.com today!
---
You are currently subscribed to asp_databases as: $subst('Recip.EmailAddr')
To unsubscribe send a blank email to leave-asp_databases-$subst('Recip.MemberIDChar')@p2p.wrox.com
|
|
 |