View Full Version : More Quote Problems

02-20-2003, 05:18 PM
I know the sticky is there but my concerns are not address. I want to write out "variablename" and I want the quotes

I've used response.write "& variablename &" and response.write ' "& variablename &" ' and response.write " "& variablename &" " to no avail. Can someone please help.

my output ranges from nothing at all, to quotes around variablename but not the value of variablename which I desire.

I want as output "variablename" where variablename is actually the value of variablename.


02-20-2003, 05:42 PM
OK, I figured it out but I chickened out and used assci characters. I used

response.write Chr(34) & variablename & Chr(34) and I got the desired results but I would hope it is a simpler way.

Thanks everybody.

02-20-2003, 05:49 PM
Maybe it doesn't work. I am trying to finish what I started from a post before and I am at this part where I am trying to get only the tables that aren't in focused to write.

the code is as follows

if NOT Rs ("TABLE_NAME") = "MSysAccessObjects" AND NOT Rs ("TABLE_NAME") = "MSysAccessXML" AND NOT Rs ("TABLE_NAME") = "MSysACEs" AND NOT Rs ("TABLE_NAME") = "MSysObjects" AND NOT Rs ("TABLE_NAME") = "MSysQueries" AND NOT Rs ("TABLE_NAME") = "MSysRelationships" AND NOT Rs ("TABLE_NAME") = Chr(34) & variablename & Chr(34) then

but this doesn't do anything, nothing. It seems as though the last bit of code is being ignored. All help is appreciated, thanks.

Roy Sinclair
02-20-2003, 07:49 PM
In ASP to get quotes within a string you need only double them up:

localvariable = "and"

response.write " before """ & localvariable & """ after"

would output

before "and" after

02-20-2003, 08:07 PM
thanks Ron, interestingly enough I figured that out already. I think my problem actual lies somewhere else. Thanks for your help, though. :thumbsup:

02-21-2003, 02:53 AM
your problem is you dont have to use double quotes at all!

this should be the correct one:

AND NOT Rs ("TABLE_NAME") = variablename then

I assume variablename contains the table name.
since it is a variable, you dont have to put quotes around it

02-24-2003, 07:02 PM
I have seen many posts that deal with quotes but this is killing me because I can't find the best solution....please help!

I want to display the results from a database that have quotes both single (') and double (") what I get is an early terminated value in the html output

<input type="text" name="txt1" size="50" maxlength = "50" value='<% =strDescription) %>' >

Thanks in advance!

Roy Sinclair
02-24-2003, 07:26 PM
Use this:

<input type="text" name="txt1" size="50" maxlength = "50" value='<%=Server.HtmlEncode(strDescription)) %>' >

02-24-2003, 07:53 PM
<input type="textarea" name="txt1" size="50" maxlength = "50" value='<% =Server.HTMLEncode(str1) %>' ></textarea>

Works like a charm....

Thanks again!

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum