Solved

' interrupts string input

Posted on 1998-07-27
4
184 Views
Last Modified: 2011-09-20
In a web application (uses ASP), users are asked to answer a question through a multiple-line input box. When using the ' char, as in "I'm", the input following to that gets ignored when storing the data in the database. I know the cause - but how can I prevent it from occuring?
0
Comment
Question by:ribbegrd
  • 2
4 Comments
 
LVL 2

Accepted Solution

by:
connex earned 100 total points
ID: 1089231
Just put the String you send to the SQL-Server in "<string>"
This should solve that.

0
 

Author Comment

by:ribbegrd
ID: 1089232
How exactly should this be done? My app reads stuff off a form, and then directly inserts it. Where should the <string> tag be?
0
 
LVL 2

Expert Comment

by:connex
ID: 1089233
depends on how you construct the statement. Maybe email me some
sample code and I can send you back a version that does is.
My Email is us@datapec.datagroup.de

0
 
LVL 28

Expert Comment

by:sybe
ID: 1089234
using the Replace function replace the ' with 2x '

REPLACE(Request.Form("field_whatever"), "'", "''")

But you can also URLEncode the string and URLDecode it back when you get the data from the database.

0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Nowadays, some of developer are too much worried about data. Who is using data, who is updating it etc. etc. Because, data is more costlier in term of money and information. So security of data is focusing concern in days. Lets' understand the Au…
Slowly Changing Dimension Transformation component in data task flow is very useful for us to manage and control how data changes in SSIS.
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now