473,806 Members | 2,845 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

replace

Hi.
I have a form with a couple of text fields where users can enter some data.
The data is stored in an access DB.
the problem is that whenever a user enters " in a textbox some of the text
dissapears.
Example:
If the users writes: I have a 17" LCD for sale
Then this is what is stored in the DB: I have a 17

How can I store the whole text in my DB? Or how can I remove it altogether?
I've tried Replace(myStrin g, chr(34), "-") but that didn't work.

any help is greatly appreciated!

Thanks,
Shawn
Jul 19 '05 #1
6 2133
Shawn wrote on 06 sep 2004 in microsoft.publi c.inetserver.as p.general:
If the users writes: I have a 17" LCD for sale
Then this is what is stored in the DB: I have a 17

How can I store the whole text in my DB? Or how can I remove it
altogether? I've tried Replace(myStrin g, chr(34), "-") but that didn't
work.


[if we are talking about ASP-vbscript you would have to double the
"doublequot e"]

myString = Replace(myStrin g, chr(34), chr(34)&chr(34) )

not tested.

Another possiblility is to change it to
a double-acute accent or double-grave accent

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress,
but let us keep the discussions in the newsgroup)

Jul 19 '05 #2
unfortunately it didn't work...

Shawn

"Evertjan." <ex************ **@interxnl.net > wrote in message
news:Xn******** ************@19 4.109.133.29...
Shawn wrote on 06 sep 2004 in microsoft.publi c.inetserver.as p.general:
If the users writes: I have a 17" LCD for sale
Then this is what is stored in the DB: I have a 17

How can I store the whole text in my DB? Or how can I remove it
altogether? I've tried Replace(myStrin g, chr(34), "-") but that didn't
work.


[if we are talking about ASP-vbscript you would have to double the
"doublequot e"]

myString = Replace(myStrin g, chr(34), chr(34)&chr(34) )

not tested.

Another possiblility is to change it to
a double-acute accent or double-grave accent

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress,
but let us keep the discussions in the newsgroup)

Jul 19 '05 #3
On Mon, 6 Sep 2004 20:54:21 +0200, "Shawn" <bo********@hot mail.com>
wrote:
Hi.
I have a form with a couple of text fields where users can enter some data.
The data is stored in an access DB.
the problem is that whenever a user enters " in a textbox some of the text
dissapears.
Example:
If the users writes: I have a 17" LCD for sale
Then this is what is stored in the DB: I have a 17

How can I store the whole text in my DB? Or how can I remove it altogether?
I've tried Replace(myStrin g, chr(34), "-") but that didn't work.
What exactly didn't work?
any help is greatly appreciated!


Replace(myStrin g, ", "")

Jeff
Jul 19 '05 #4
Shawn wrote on 06 sep 2004 in microsoft.publi c.inetserver.as p.general:
"Evertjan." <ex************ **@interxnl.net > wrote in message
news:Xn******** ************@19 4.109.133.29...
Shawn wrote on 06 sep 2004 in
microsoft.publi c.inetserver.as p.general:
> How can I store the whole text in my DB? Or how can I remove it
> altogether? I've tried Replace(myStrin g, chr(34), "-") but that
> didn't work.
[if we are talking about ASP-vbscript you would have to double the
"doublequot e"]

myString = Replace(myStrin g, chr(34), chr(34)&chr(34) )

not tested.

Another possiblility is to change it to
a double-acute accent or double-grave accent

unfortunately it didn't work...


[please do not toppost on usenet, topposting corrected]

I gave you 3 possiblilties.

"didn't work" gives nor enough information.

1 Which did you test?
2 How did you test them?
3 Did you test it in an ASP page using vbscript?
3 Could you please test the following:

<%
myString = "this '""' is a doublequote"
myString = Replace(myStrin g, chr(34), "#")
response.write myString
%>

does this return '#'?

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress,
but let us keep the discussions in the newsgroup)

Jul 19 '05 #5
Jeff Cochran wrote:

Replace(myStrin g, ", "")


Shouldn't that be Replace(myStrin g, """, """") ?

--
Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms. Please do not contact
me directly or ask me to contact you directly for assistance. If your
question is worth asking, it's worth posting.
Jul 19 '05 #6
"Shawn" wrote in message news:eR******** ******@TK2MSFTN GP12.phx.gbl...
: I have a form with a couple of text fields where users can enter some
data.
: The data is stored in an access DB.
: the problem is that whenever a user enters " in a textbox some of the text
: dissapears.
: Example:
: If the users writes: I have a 17" LCD for sale
: Then this is what is stored in the DB: I have a 17
:
: How can I store the whole text in my DB? Or how can I remove it
altogether?
: I've tried Replace(myStrin g, chr(34), "-") but that didn't work.

What exactly does "that didn't work" mean?
You have a logical OR request but then gave a negative result response.

If you want to replace a double quote with a hyphen, then replace(myStrin g,
chr(34), "-") should work. This should also work: replace(myStrin g, """,
"-"). However, not being able to see your code leaves us with the
probability you made an error in your coding.

if myString = I have a 17" LCD for sale
then this:
myString = replace(myStrin g, """, "-")
would result in myString having a value of:
I have a 17- LCD for sale

Perhaps showing relevant code might reveal the error?!

--
Roland Hall
/* This information is distributed in the hope that it will be useful, but
without any warranty; without even the implied warranty of merchantability
or fitness for a particular purpose. */
Technet Script Center - http://www.microsoft.com/technet/scriptcenter/
WSH 5.6 Documentation - http://msdn.microsoft.com/downloads/list/webdev.asp
MSDN Library - http://msdn.microsoft.com/library/default.asp
Jul 19 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
3033
by: Craig Keightley | last post by:
Can these lines of sql statements be consolidated into one sql statement (possibly using reg exps??) BEGIN CODE ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Update applications Set news_article = replace(news_article, '<FONT face="Times New Roman" color=#000000 size=3>', ''); Update applications Set news_article = replace(news_article, '<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt">', ''); Update...
12
8176
by: Barnes | last post by:
Does anyone know of a good way to use the JavaScript string.replace() method in an ASP form? Here is the scenario: I have a form that cannot accept apostrophes. I want to use the replace() so that the apostrophe is automatically replace with two '' . Reason being--SQL Server does not like apostrophes being sent to database. I've tried to do this on the server side in the SQL area of the ASP page by writing a function (with some great...
6
5680
by: Danny | last post by:
I need an asp command to strip out from a string all extra punctuation such as apostrophe, comma, period, spaces dashes, etc etc and just leave the letters. Can anybody give me some ideas? Thanks
9
9163
by: Peter Row | last post by:
Hi, I know this has been asked before, but reading the threads it is still not entirely clear. Deciding which .Replace( ) to use when. Typically if I create a string in a loop I always use a StringBuilder. At present I am porting a VB6 webclass app to VB.NET and therefore I am trying to make it as efficent as possible via the new functionality of VB.NET.
4
3858
by: Cor | last post by:
Hi Newsgroup, I have given an answer in this newsgroup about a "Replace". There came an answer on that I did not understand, so I have done some tests. I got the idea that someone said, that the split method and the regex.replace method was better than the string.replace method and replace function. I did not believe that.
3
3325
by: Goran Djuranovic | last post by:
Hi all, I ran into a problem where my XMLTextReader fails on .Read() when I have "<" character in one of the attribute's values. What I am trying to do is replace illegal characters ("<", "&" , etc.) with legal stuff ("&lt;", "&amp;", etc.), before I send the XML text to a SQL Server stored procedure. Currently, I am using XMLTextReader and StringWriter to do this, here is the piece of code that fails:...
3
16930
by: TOXiC | last post by:
Hi everyone, First I say that I serched and tryed everything but I cannot figure out how I can do it. I want to open a a file (not necessary a txt) and find and replace a string. I can do it with: import fileinput, string, sys fileQuery = "Text.txt" sourceText = '''SOURCE'''
6
15595
by: JackpipE | last post by:
Here is my replace query and I need to run this on every column in my table. Right now I manually enter the column name (_LANGUAGES_SPOKEN) but this is time consuming and would like to automate this process as much as possible. Update PROFILE SET LANGUAGES_SPOKEN = replace(cast(_LANGUAGES_SPOKEN as nvarchar(255)),char(13)+char(10),':') Thanks,
5
9311
by: V S Rawat | last post by:
I was trying to use back-to-back replace functions to convert a url: str1 = str.replace("%2F","/").replace("%3F","?").replace("%3D","=").replace("%2 6","&"); It didn't replace all 4 types of strings. Then, I googled and found this suggestion of some JavaScript Tutorials, so I used replace with a regex with a global switch:
15
1910
by: =?Utf-8?B?TWlrZSAiWU9fQkVFIiBC?= | last post by:
I have a text file that contains about 8 to 10 text sequences that I need to replace. I want to search and replace all 8 to 10 text sequence anytime I run this script Here is what I have so far. Const ForReading = 1 Const ForWriting = 2
0
9719
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10366
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10371
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10110
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7649
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6877
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5546
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4329
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3008
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.