Replacing Single Quote
I have a code that goes to the url of the company.My problem is that if a company name has a single quote in it,it tries to end the statement.I tried a replace as you will see,but still doesn't work.Heres my code:
Response.Write "<td><center><a href='edit.asp?company="
Response.Write server.URLEncode(replace(rs("Company"),"'","'"))
Response.Write "'>Edit</a></center></td>"
View Replies
ADVERTISEMENT
I have a simple form submission but the problem is my SQL insert (or update) is failing if in the text field there is any single quotes (')
I tried running the like replace(textfield,"'","") to just remove them but it will still error out on me.
is there any other way to format the variable, do I need to use an escape character?
View Replies
View Related
Running into a what I thought should be a small problem but it's going on an hour and I still can't figure it out
Reading an excel file and running queries on Sheet names. The problem is when there is a single quote in the sheet name.
selectQuery = "SELECT * FROM Dave's Sheet"
I tried to use
selectQuery = "SELECT * FROM Dave's Sheet"
But that doesn't work either.
It keeps bombing the query. Not matter what I try I can't get this to work. I can't replace the single quotes because then it can't find the tab name. Any ideas?
View Replies
View Related
how i could insert data into my DB that contained apostrophes. for example, I wanted to insert Bailey's well, my SQL statement was being cut off when it hit the ' and i was getting all sorts of errors. i was writting some complex stuff to take out the ' then re-insert it when being displayed.lots of work then i thought, what if i replace my ' with " in my insert statement.
like i said, some of you may know this, but i thought id share my experience with you just in case someone runs across the same problem.
View Replies
View Related
I am having a problem with a single quote in my URL. I use HTMLEncode and all is good on my machine, but when I test it with a browser from a different machine, I get 403 on invalid characters. More, it seems to me that the URL gets truncated after that single quote that I have in my URL.
View Replies
View Related
I'm trying to produce an image with a javascript link. The problem seems to
be with the single quote. Here is the code that I wrote:
response.Write("<a href='javascript:PopUp('http://www.yahoo.com')'><img src='image1.jpg' width='50' height='67'></a>")
When I preview the page and roll over the image, the link is truncated to just javascript:PopUp( .
I've tried creating the link with a string like below.
strLink = "javascript:PopUp(" & " ' " & "http://www.yahoo.com" & " ' " & ")"
The string displayed properly when printed on screen, but when I tried to use it as the link it truncated again. I'm not real sure what to try next.
View Replies
View Related
I have a rather basic question. I have a simple username and password front end that queries a SQL database, I run into problems when one of the user names has a single quote in it (IE: O'brian).
I get the "Microsoft OLE DB Provider for SQL Server error '80040e14' Line 1: Incorrect syntax near 'brian'." error message, any clues on how to display those particular cases? is there anything in particular that should be done to my SQL statement?
View Replies
View Related
i want to place single quote in customer name. how?
View Replies
View Related
Where would i put this code:
replace(fieldToInsert, "'", "''")
to solve the problem of inserting these types of illegal characters into the database.
Heres the code which i need it to be in:
Code:
View Replies
View Related
I have a asp page where part of the code is as follows. This builds up the sql statement partially.
sql01 = "UPDATE EquipmentTbl SET "
sql01 = sql01 & "SerialNumber = '" & request.form(strSerialNum) & "', "
sql01 = sql01 & "Description = '" & request.form(strDesc) & "', "
sql01 = sql01 & "Location = '" & request.form(strLoc) & "', "
RESULT OF PARTIAL UPDATE STATEMENT USING RESPONSE.WRITE IS:
UPDATE EquipmentTbl SET SerialNumber = 'A83737', Description = 'Video
Conferencing Equipment', Location = 'Conference Rooms cabinet',
Now, in the above, I would like to be able to put the location field as 'Don's room'. In other words, I would like to handle the aprostrophe after Don. With this in mind I am changing the code as following: Code:
View Replies
View Related
I read that the "?" caracter can make you trouble with some search spiders. Although I know the Spiders are upgrading to evade this indexing problem, it is still an obstacle for some search engines.How can you refrain from using "?" in urls, for example, in a dinamically runned site?. Some CMS do it replacing that caracter with the slash bar "/", that is more spider-friendly.
In brief:
1. Is "?" still giving problems?
2. In case it's still making problems. How can I replace it?
View Replies
View Related
Is it possible to grab stock quotes (with of course the 15min delay!!) and place within an ASP page?written in ASP.it is possible to read HTML content on webpages without outputting them and then using the values etc
View Replies
View Related
I'm trying to make a dynamic table where on the left side items are placed and on the right side the item clicked is shown. For an example look at www.uitdagen.nl uitgaan->cafes
This all works fine except when I use a ' or a newline a error is generated because in dhtml a ' is used to open and close a string. When i use a ' in the string it goes wrong because i already close the string in the string.
If already tried to use chr(39) etc. But this won't work because this still will generate a ' for the dhtml.
View Replies
View Related
I am writing an asp app for generating quotes. What I would like to do is allow the user to edit the quote lines without having to open a new page each line.
On the quote I have created a loop which goes through the recordset and populates a sort of data grid. Can you use javascript or something so the user can click an edit icon on the appropriate line item in the grid and edit the line details there instead of having to open another page to edit the line item.
View Replies
View Related
I have this simple Select:
Select * from MATABLE WHERE title = '"&myvariable&"' ORDER BY title
so some of my title have single quote/apostrophe in them, ex: Don't know me . so when I tried to access those article with that kind of title I get the error message Missing operator. So is there a way to have my title be all right? a function maybe?
View Replies
View Related
Does Anybody Know Howto Switch All Positive Signs(+) For Negitive Signs(-) And Negitive Signs For Positives?
View Replies
View Related
that is generated by a database that I don't have access to?
So, I use a database drived store. It is not open source, so I do not have access to adjust the HTML that is generated.
Unfortunately, the code is fairly messy, and contains un-necessary breaks, paragraphs, and other code that I don't want there! A lot of it I've been able to adjust with css, but the biggest thing that bugs me, is that there is a table and a td that are at a set width. It is set at 'width=550'. I would like to either remove that, or change it to 'width=95%'.
Is there anyway I can accomplish this? What I do is create a template .htm page that the asp uses. Is there anything I can do in the .htm to replace or remove this HTML? Javascript? A snippet of ASP code? Or should I just learn to live with it?
View Replies
View Related
I need to replace some dynamical content away from a text, only static thing
is that it starts with <!-- Start dynamic --> and ends with <!-- End dynamic
-->. How do i dynamical remove these two tags and all the content between
them?
View Replies
View Related
I'm sure this isn't difficult, but it's Friday afternoon (!).
I'm trying to use a regular expression to match html tags in a string
and convert them to lower case. It's the RegExp object that I'm
struggling with rather then expression syntax.
So far I have this ('HELP!' denotes where I'm stuck):
private function recoverHTML(sHtml)
dim oRegExp
set oRegExp = new RegExp
oRegExp.IgnoreCase = False
oRegExp.Global = True
oRegExp.Pattern = "<(.*?)>"
sHtml = oRegExp.Replace(sHtml, HELP!)
set oRegExp = nothing
end function
I'm thinking of something like this:
"<" & lcase($1) & ">"
What syntax do I need here?
View Replies
View Related
With hosting for clans, more so then not, the clan tags contain charactures
like + { [ in front of the tag letters.
what I am having a problem with is if it starts with a +, it isn't picking
up the name correctly. If in a sql statement, it looks for a tag that starts
with a +, it won't find it. And sometimes, when it is supposed to move the
tag over in a bracket, it moves it without the +.
for example, +EcK+ is the tag, it will either not find it, or move it over
as EcK without the +'s.
is there any way around this?
i know for some strings, such as things with ' you can use
replace (request.form("var"), "'", "''")
View Replies
View Related
I put in some code to keep apostrophes from being a problem. However, on the
display page, they have double quotes. What am I doing wrong?
Here is the code on the page which captures the data from the form, right
before it gets entered into the database:
------------------------------------------
strInternalDesc =
Replace(Replace(Trim(Request.Form("InternalDesc")),"'","''"),vbCrLf,"<br>")
------------------------------------------
then, on the page where it gets displayed, I get:
View Replies
View Related
I want to mask part of a field upon displaying it. field name is "IP", how do I mast the first 4 characters with "*" symbols?
View Replies
View Related
I have a printer friendly page script, that outputs the text less any includes, it works well in IE, but firefox grabs the "'<%@LANGUAGE="VBSCRIPT" %>" and outputs it to the print version page. SO i get a nice printer version - but with <%@LANGUAGE="VBSCRIPT" %> at the top.
Does anyone know how to write a conditional region like:after <body> if string is "<%@LANGUAGE="VBSCRIPT" %>" replace with ""?
View Replies
View Related
i am having trouble getting my REPLACE fn. to replace whole words only. basically, i'm running a 'spelling checker' fn. that uses the REPLACE fn. to find incorrect spellings and replace them. problem is, the fn. seems to replace all instances of a string, and not a whole word only as I intend it to be:
Code as follows:
StrInput = Request.Form("BKM_Search")
StrInput = LCase(StrInput) 'convert all to lowercase
StrInput = Trim(StrInput)'trim all empty space b4 & after string
StrCorrect = Replace(a_StrWrong, a_StrRight,1,1,1)
Let's say I want to replace the word "sea" with "ZZZ" only:
Example input: "Sean has some neat sea shells"
Example output: "ZZZn has some neat ZZZ shells"
View Replies
View Related
I've got an Access database with a memo field with large amounts of text in. In Access forms the text appears with line breaks where the enter key has been pressed. I'm using ASP to display this content on a simple webpage but want it to appear with the same line breaks as in the Access forms.
This is the code that I've got but it doesn't seem to work.
<% Article = rs("Article")
Article2 = Replace(Article, "<br>", chr(13))
%>
<td valign="top" bordercolor="#FFFFFF" bgcolor="#FFFFFF"><div id="ArticleStyle" align="justify">
<% =Article2 %>
</div></td>
View Replies
View Related
I am working on building an asp forum, (I have posted a few times with questions ) and it works for the most part now, but I am trying to fix some things.
I am storing posts in a memo field. Originally it was text fields, but 255 characters is just not good enough.
Now, posts are saved fine except for 2 things:
1/ " and ' cause errors. These are causing conflicts with my INSERT SQL statement that is made. How would you get around this problem, I wonder?
2/ New lines etc are not being put into the memi field. I can live without this for the time being, but at some point I will want to implement posts being outputted in the same format they were inputted. Any advice on how to deal with this issue?
View Replies
View Related
I am having trouble getting the 's and +s on this statement correct. The first select line works as it is supposed to but the 2nd one does not. Can anyone correct this and perhaps tell me/point me in the direction of the rule of thumb for stuff like this?
Code:
<SELECT size="1" name="waste" onChange="window.location='drumsnew.asp?waste='+this.value+' &c_type=<%=Selected_Container_Type%>'+'&c_size=<%=Selected_Container_Size%>';">
<SELECT size="1" name="ctype" onChange="window.location='drumsnew.asp?waste='<%Selected_Waste_Type%>'+'&c_type='+this.value+'&c_size=<%
=Selected_Container_Size%>';">
View Replies
View Related
I seem to end up with too many double quotes when using this clean up function.. either that or I am missing a display function when I display the details from the dB.
My function
Code:
Function CleanFormFields(FieldString)
FieldString = Replace(FieldString, "�", "'")
FieldString = Replace(FieldString, "�", """""")
FieldString = Replace(FieldString, "�", """""")
FieldString = Replace(FieldString,"""","""""")
FieldString = Replace(FieldString, "'", "''")
FieldString = Trim(FieldString)
CleanFormFields = FieldString
End Function
I only really wanted the microsoft ouble quote to become one set of double quote instead of double as I have here but I can't get away with anything less.
essentially when I input a � I get a "" when I only want ".
View Replies
View Related
If rs("MyString") is Hello "Jim" Lad
<input type=text value="<%=rs("MyString")%>">
prints as <input type=text value=" Hello "Jim" Lad">
How can I get double quotes to display in a text box or textarea? Using a backslash or &Quot; (with Replace() e.g.) just prints out the backslash or &Quot;
View Replies
View Related
Here's the line I need to insert into an ASP page.
<script Language="JavaScript" src="/blarg.js"></script></head>
Right now it throws off the asp include with the quotes.
View Replies
View Related
I've got a form which lets users input HTML code into a database (the user enters their code into a form field, then submits, and the HTML is written to a db). This code is then pulled out of the database onto a web page. It must validate - so needs to have all characters intact.
How do I perform an update statement which lets me insert double quotes into the database? I know it's possible to achieve a similar thing by replacing the double quotes with some other characters on insert, then replacing these other characters with double quotes when the data is pulled out of the db, but this seems a bit messy.
View Replies
View Related
How should I pass a " (doble-quote) character to response.write() in order for it to be sent to the output ?
View Replies
View Related
Does anyone know how I can detect if a image is missing from the server before the browser tries to render it, I guess this would have to be done via some sort of preloader, the problem being I am the site in question has around 30,000 images and keeping on top of missing images is a impossiblility.
View Replies
View Related