Ignore Quotation Marks
I can't seem to find the right way to do this, how do I get ASP to ignore a quotation mark in a string? " doesn't work.
View RepliesI can't seem to find the right way to do this, how do I get ASP to ignore a quotation mark in a string? " doesn't work.
View RepliesWhen do you use quotation marks around values in an SQL Statement, and when do you ignore the quotation marks completely?
View Replies View RelatedI have a number of records I need to display in a list box (dynamic) - some have quotation marks and the system chokes on them.. whats an easy way to overcome this?
View Replies View RelatedI am trying to copy an uploaded document from one directory to another. The uploaded file (attach1) will be dynamically named. The resulting file (LName) name is based on a last name field. I have the following code but I cannot figure out how to deal with the issue of quotation amrks. Should I escape them or do I use another method?
dim fs
set fs=Server.CreateObject("Scripting.FileSystemObject")
fs.MoveFile "E:Inetpubwwwrootuploads<%=(frmSend.Fields.Item("attach1").Value)%>.doc","E:Inetpubwwwrootuploads
amed<%=(frmSend.Fields.Item("LName").Value)%>.doc"
set fs=nothing
Just like my other post about quotation marks not appearing,I am having trouble with foot marks (').
They are going in as ' but are appearing on the user's end of the database as ` Minor.
The following removes any unwanted apostrophes before being inserted into an sql database:
Articletext = replace(articleText,"'","''")
..but if I need to remove all quotation marks, this doesnt work:
Articletext = replace(articleText,""","''") Code:
Just wonder how you guys handle the single quatation marks when you write the value of a text input into SQL server.
View Replies View RelatedI originally believe this was a database issue untill I tried to run this using just pure forms.
Issue. I have a form (basic form) and at one of the steps.. the user inputs an article name (and in this case.. there is a set of doublequotes used in this name).
I used the name ( In "Search" of the three Ethical Reviews )
<input type="text" name="Article">
Now I filled in the rest of the data Including a large section with just paragraphs of text that includes quotations marks, slashes, etc etc.
I click the submit button which Transfers all this information into a review page. The review page is another asp page that merely drags all the info from the last page and displays it on the screen for re-editing. Example Code:
if I read an XML document using ASP without any encoding, ican read it fine, but if an XML document contains an encoding parameter, like the following, ...
<?xml version="1.0" encoding="ISO-8859-1" ?>
... then it doesnt work and just stops working with no errors.
Can I ignore the encoding, if so how?
I need to truncate a news article to only show a certain number of characters on the front page. the news articles often contain html and the characters in the html are being counted. So, even though I want the text to be truncated at, say, 350 characters, the final result on the page looks like it's been truncated way further up, because the text of the html added to the character count.
here's the code i'm using to truncate
URLFunction ChopLastWord( Line, Length )
If Len(Line) < Length Then
ChopLastWord = Line
Exit Function
End If
Dim spaceat
spaceat = InStrRev( Line, " ", Length )
If spaceat < Length-20 Then spaceat = Length ' value of 20 is arbitrary
ChopLastWord = Left( Line, spaceat ) & "..."
End Function
i am currently working on code that searches an excel spreadsheet and displays results. Below is the code for the drop down. I was wondering is there a way to modify this to ignore blanks as when i use the drop down, it contains the blank cell spaces Code:
View Replies View RelatedI'm using the replace functions but it is case sensitive. I'm doing a search through my DB and I want the keywords I use in the query to come out in bold so basically I do a:
Code:
strResults = searchRS("pgdescription")
for j = 0 to (Ubound(newArray))
strResults = replace(strResults, newArray(j), "<strong>" & newArray(j) & "</strong>")
next
it spits out my results but it doesn't bold them unless they're the exact same case... Anyone know a way to make the replace function ignore cases?
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?
When the quote mark (") is the last character on a string, it does not output on input boxes because the application reads it as the end of the value. How can I get the quote mark to appear in input boxes?
View Replies View RelatedI am working on a date function, which takes a YYYY-MM-DD input and splits it into dd,mm,yyyy format. e.g:
string1 = "2006-10-20"
Function stripDate(str)
str_len = len(str)
if str_len = 10 then
str = replace(str, "-","")
str_yr = left(str,4)
str2 = right(str,4)
str_mo = left(str2,2)
str_dy = right(str2,2)
stripDate = str_dy & "," & str_mo & "," & str_yr
else
Exit Function
end if
End Function
test = stripDate(string1)
sample output: 20,10,2006
I then want to pass the sample output into another function, but in order to do that, the date variables must be split with speech marks as follows:
"20","10","2006"
but I can't work out how to include that in the stripDate function so that it wraps the variables in speech marks. Whenever I try to include the speech marks the code returns the usual error about unterminated string constants e.g. if I replace the final line of the above function with this:
I'm asked to do Quotation and Invoive modules using asp. To come out with the Quotation or Invoice will not be a problem but I think printing them from the browser will be a problem. The quotation should be formated and printed as if it printed using excel with proper alignment and if the details exceeds the first page it should have the closing line and the next page should have the table header ect.I'm not sure whether this is possible to print in this way from the browser.
If this is not achievable I'm thinking of creating an excel file put all the data inside and open it for the user to print it from excel.Could anyone guide me which will be better way.If creating excel file is a better option sample script.
how can i decline a ' character in asp?
View Replies View RelatedOne thing I've started to notice lately is that asp seems to be very sensitive to how quotation marks are layered. Does anyone know where I can find out when to use double quotes and when to use single quotes? Code:
SelectSQLB = "SELECT * FROM TeamRosters WHERE IDNumber = Session(' 'TeamMember' & LoopCounter')"
Is the line that's giving me trouble and I'm not really sure how to layer it. Every logical combination I've tried has produced a different sort of error. Note that TeamMember# is a session variable and loopcounter is a local variable used to select which TeamMember# session variable to use. Before I've noticed that pretty much it works like this: " ' ' " but that was for two layers deep. What's the syntax for going three layers in?
I am looking for a way that I can trap the single quotation mark. If an
encoder uses single quotation mark on a textbox field, it always give me an
error because I use single quotes on the SQL statement.
what is the easiest way to display Yes/No, True/Falst, On/Off MS Access fields as check marks on an ASP page? it would be either checked or unchecked.
View Replies View Related