Solved

' interrupts string input

Posted on 1998-07-27
4
191 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
store vs query adhoc - no show rows 4 37
Create a Calendar table 29 45
learning MS SSIS 13 23
SQL Server View  - Timeout Expired 5 14
Let's review the features of new SQL Server 2012 (Denali CTP3). It listed as below: PERCENT_RANK(): PERCENT_RANK() function will returns the percentage value of rank of the values among its group. PERCENT_RANK() function value always in be…
Introduction In my previous article (http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/SSIS/A_9150-Loading-XML-Using-SSIS.html) I showed you how the XML Source component can be used to load XML files into a SQL Server database, us…
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

738 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