ESCAPE CHARACTER
I'm having a problem finding/using an escape character with this ASP/JScript application I'm creating. Basically I have text sometimes that has apostrophes or double quotations in them, but they won't be INSERTED unless I manually take them out.
Ex: INSERT INTO tbl1 (vendor,reason) VALUES (81,"This is only a test, but there is an apostrophe and it's only going to make things worse.")
That apostrophe in "it's" is kiling everything. I've used the replace method to change it to " ' ", but that STILL doesn't work. I can't find MS SQL's ESCAPE CHARACTER. I've tried several directions of the backslash, but no luck.
View Replies
ADVERTISEMENT
I am trying to only have a link show if there is a certin value in the DB. This is what I am trying:
<% if (rsWelcome.Fields.Item("access_level").Value) = "admin" then
response.Write("| - <a href="sps_main.asp">Sales Training Support </a>-")
end if %>
BUT... this is the error I get:
Expected ')'
/sta/topnav_test.asp, line 9 response.Write("| - <a href="sps_main.asp">Sales Training Support </a>-") How do I use quotes in a "response" and have the app server ignore them??
View Replies
View Related
Info
DB: Oracle(9i), where I generate query strings programatically and send them to the DB server.
I have rtfm'd and googled this extensively, but I have not found how to properly esacape the ampersand character in an oracle query (I'm NOT using the SQL+ command line interface).
Oracle uses the & character to denote a variable substitution, and unfortunately one of the fields I must query has data that contains the & character. I need to know how to escape the & character in my query strings so that Oracle will treat it as a string literal. Code:
View Replies
View Related
I am inserting records into an Access table using the OleDbCommand class. The insert values come from a basic web form with text boxes. If the values contain ' or " it creates a problem. What is the proper way to escape these characters? Surely there's a built-in function for it somewhere.
View Replies
View Related
I working on a ASP project (usually I'm a PHP guy) and I wanted to encode a string to make it safe for a SQL insert. Is there a function built into ASP for that or do I just need to replace single quotes?
View Replies
View Related
the problem is in database the name of customer displays like
%mike O' lee but user want to see name like mike O lee.
How can i do it in asp script.
View Replies
View Related
I've a problem reading querystring parameters that are 'uri encoded'. Anyone
has a solution for this?
To reproduce the problem, create a classic ASP containing the following code:
-----------------------
<p>Value sent via querystring: <%=
Server.HTMLEncode(Request.QueryString("value")) %></p>
<input id="input" />
<button id="submit" onclick="window.location.assign('Test.asp?value=' +
encodeURIComponent(input.value));">submit</button>
-----------------------
Now, enter the value "Dré" and submit. The page will show the value "Dré",
but I except Request.QueryString("value") to return the original value, i.e.
"Dré".
View Replies
View Related
I'm still having trouble getting some of my data being returned properly when people use quotes. (ex ProjectName contents being - the "primary" project - The double quotes are the main issue. I am using a function for the single quote and it seems to have resolved the issue.
Code:
Term = trim (Term)
if Term <> "" then
Term = Replace (Term, chr (39), chr (39) & chr (39))
end if
If Term <> "" then
I use this just when passing strings from a form. I tried altering it and using chr (34) for a double quote but it didn't work.
View Replies
View Related
Is it possible to escape asp tags so i can add em to another variable like this:
text = "<% downloads="&cats&" %>"
View Replies
View Related
When chucking data in cookie you cannot use certain characters in this example ‘ : ‘ . To get around this you use escape and unescape. Trying to use the escape as such:
Response.Cookies("Lines")("URL4") = escape("http://www.ASP101.com")
Gives the following result:
URL4=http%3A//www.ASP101.com
Which I don't think does anything to help. So using it like this:
Response.Cookies("Lines")("URL4") = "escape(http://www.ASP101.com)"
Gives the following result:
URL4=escape(http://www.ASP101.com)
Which is the correct result apart from the ‘escape' actually appearing.
View Replies
View Related
im tryin to do this:
response.write("<body topmargin='0' leftmargin='0' onLoad='window.resize('" & width & "', '" & height & "')'>")
i need to run it like this though:
response.write("<body topmargin='0' leftmargin='0' onLoad="window.resize('" & width & "', '" & height & "')">")
in php i can replace it like onLoad = "window.resize
is there something like that in asp?
View Replies
View Related
is escape char in asp script and how we can encode the url in asp script?
View Replies
View Related
I've been looking for it for a while. I found it a week back by accident, but didn't need to use it then. It's a function that escapes SQL strings so that if there is a ' in the string it will escape it for you. I can remeber the name of it.
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 have a 'memo' form field being entered into an access database.If people put in characters other then text (Quotes, operators, etc) then I get an insert error:
----
User Input: oh let's see - a va
Error:
[Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in query expression ''oh let's see - a va', 'No additional comments submitted')'.
----
Is there a way to get this into the database? In php, I would simply use the function 'addslashes()' (escaping the string) - is there a similar function in ASP or am I doing something else wrong?
View Replies
View Related
i need to convert the escape values which are by mistake updated in DB.
example:
this is a sample text string
is updated in DB as
this%20is%20a%20sample%20text%20string
here %20 is the space.
like wise there are many entries for :,'
is there way that i can update all this in a update statement?
or use asp to to update the records?
View Replies
View Related
I have a login form in which i have logins for company as 'National City"
But when i capture the login name to give it in my query on some other form as Request.Querystring(username)
Its recognises it as National%20City...
i dont want to chhange my login names and keep it as NationalCity as one full word.How can i tell ASP to recoginze this as a space in the query ?
View Replies
View Related
How do I delete the last character in a string?
View Replies
View Related
I am using mySQL with ASP. I have a trouble with Turkish characters as I am
tring to get and display data from mySQL database. However, I can see whole
Turkish characters exactly when I use phpMyAdmin.I used the following tags on HTML but I couldn't achieve to display Turkish characters in any way.
mySQL database lang: latin5_turkish_ci
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-9">
and
<% @Language = "VBScript" Codepage="1254"%>
Session.LCID = 1055
Session.CodePage = 1254
View Replies
View Related
We have an application which uses surname and the date of birth to allow people to login.
The SQL gives an error if the user's surname contains the character '
View Replies
View Related
I'm trying to set a session variable where two variables are seperated by a backslash:
Dim a
Dim b
a = Request.QueryString("Class")
b = Request.QueryString("Group")
Session("FTEClassGroup" & y) = a + "/" + b
I can't get this to work? I'm not sure, but is the backslash being seen as a string instead of the actual backslash character?
View Replies
View Related
i m declare one variable and it hold the name of a person
eg: strName = "Arvind Singh"
and i want to put first four character in an other variable please tell me the way to do this.
View Replies
View Related
I have a partner sending me by post method to an asp page some text (xml
string).
It arrives to my page encoded as follows
%9a%2f%Purchaseorder%3....f
The < and > and spaces are replaced by nuùmbers and percentage sign
I am using Request.BinaryRead(BytesTotal) and then doing response write and
I am getting exactly the same string with the encoding
How can tell my asp page to translate the encoded text to normal text?
View Replies
View Related
How do I remove those special characters in a variable? I think there are a dozen special character and so I use a dozen replace object. Is there an object that call this in one call instead of a dozen?
View Replies
View Related
I wonder why my computer with UK settings returns '$' when I call the 'FormatCurrency' function?
View Replies
View Related
The application should have a way of alerting the user if it does not recognize a character used by the website and give the user the ability to make adjustments to the unrecognized characters. The system should then remember the characters that have been adjusted by the user.
View Replies
View Related
can someone please tell me how to add the " character to a string
i've already tried:
<%
dim string
string = "something"
string = string & """
%>
string should equal something" but doesn't work ?
View Replies
View Related
how can I add "vbCrLf" after every 80th character of a string. Suppose there is a string containg 600 characters and I want to pass on the string value to some variable, adding "vbCrLf" code after every 80th character.
View Replies
View Related
some one cuts and pastes the chinese charcters.
they are saved in DB as
---- case1 : ----
& # 6 5 3 9 6 ; & # 6 5 4 2 7 ; & # 6 5 4 1 9 ;
----
i used the space above as it is converting the characters while posting..
but i noticed some few records which are saved as
-- case 2 --
ÓÀÀÖ´óµäÏ·ÎÄÈýÖÖУ
---
if values are stored as case1 then i have no problem.
but with the case2 .the chinese characters are shown good in few pages and at few pages they are shown as it like symbols.
when i cheked the its the same.what shd i do to see that in a html page these character codes display correctly?
View Replies
View Related
Is there a way to make the underscore Character display in a browser? I've
tried several different fonts but the "_" character will not display.
View Replies
View Related
ive got a string where i woulld like to remove the last character it probably seems simple 2 u but i cant work it out
can anyone tell me how to remove it.
View Replies
View Related
IF trim(request(location))="" AND trim(request(FileType))="" AND trim(request(DateMonth)) = "" AND trim(request(DateYear))="" THEN
Response.Redirect plmsearch.asp?ac=error
END IF
why is the "?" causing the invalid character? everything is coded correctly on the plmsearch.asp page.
View Replies
View Related
I have a ASP/SQL 7 application that displays data from various SQL7 Views
onto a ASP page.
A column of this data is displayed in ASP as hyperlinks and the relevent
data is put into a URL query string - so that the linked page is based on
this data ( a kind of "drill-down" effect) - Code:
View Replies
View Related