ascii in Access

  • Thread starter Thread starter LKnomad
  • Start date Start date
L

LKnomad

Hi I am creating data that will be read in an aspx doc. In order to
create symbols such as copyright or trademark in HTML we put the coding
for them into to data. An example would be for the trademark sign. We
added ™ onto the product Name. This reads correctly when we put
it into the webpage. Unfortunatly in access it does not. I am using
access as a front end for reports. When I create a report with the same
data I get ™ written out. Is there a way to make this into the
symbol?

Thanks

Laura K
 
You can use the Replace function ...

? replace("some text™ and some more text","™",chr$(169))
some text© and some more text

You'll have to repeat this for each encoded symbol.

It might have been easier to do it the other way - store the symbols, and
handle the problem in the web page. Because this is a frequently encountered
problem in web pages, there are probably established techniques for dealing
with it there.
 
Laura:

One option is to use the Character Map from Windows. Usually this is found
under the Programs/Accessories/System Tools menu in Windows. Simply copy
the symbol you want to the clipboard and then paste it into Access.

--
David Lloyd
MCSD .NET
http://LemingtonConsulting.com

This response is supplied "as is" without any representations or warranties.


Hi I am creating data that will be read in an aspx doc. In order to
create symbols such as copyright or trademark in HTML we put the coding
for them into to data. An example would be for the trademark sign. We
added ™ onto the product Name. This reads correctly when we put
it into the webpage. Unfortunatly in access it does not. I am using
access as a front end for reports. When I create a report with the same
data I get ™ written out. Is there a way to make this into the
symbol?

Thanks

Laura K
 
OK so I am a little dense since I am a web developer and not a database
person. Since the ascii code is already in the data I can not change
it at this point. I understand the concept of the replace function
because I have used something like that in asp. Where exactly does
this function go in Access. I am only concerned about the report.

Thanks

Laura K
 
LKnomad said:
OK so I am a little dense since I am a web developer and not a
database person. Since the ascii code is already in the data I can
not change it at this point. I understand the concept of the replace
function because I have used something like that in asp. Where
exactly does this function go in Access. I am only concerned about
the report.
&#8482 is not ASCII code. It is a code that lets the browser know that you
want to display a particular symbol, then the browser displays it.

Pure (original) ASCII ranges from 0 to 255 (a byte) only the first half 0
to 127 are clearly defined and the other 128 depend on where you are and
what system you are using. (Windows has standardized much of this today.)
Holding down the alt key and entering 0153 gives T (Which probably appears
as the trademark symbol on your screen)
 
Laura:

For the report, you might use the Replace function in the Control Source
property of the textbox of the field or fields that contain the web-based
encoding. For example:

=Replace([CompanyName],"™",Chr$(169))

--
David Lloyd
MCSD .NET
http://LemingtonConsulting.com

This response is supplied "as is" without any representations or warranties.


OK so I am a little dense since I am a web developer and not a database
person. Since the ascii code is already in the data I can not change
it at this point. I understand the concept of the replace function
because I have used something like that in asp. Where exactly does
this function go in Access. I am only concerned about the report.

Thanks

Laura K
 
Ok so I put this into the control source property.

=Replace([strProductName],"&#8482­;",Chr$(169))

Notice I changed the field name

Now I get #error on the report.
 
If the text box has the same name as the field ('strProductname') that will
cause an error. If that's the problem, you can avoid it by renaming the text
box.

BTW: Which version of Access is this? The Replace function was new in Access
2000, so this would not work in Access 97.

--
Brendan Reynolds (MVP)


Ok so I put this into the control source property.

=Replace([strProductName],"&#8482­;",Chr$(169))

Notice I changed the field name

Now I get #error on the report.
 
Laura:

It's hard to know exactly without seeing the report. I would check the
"strProductName" against the field list for the report (View menu/Field List
option). I did test the statement I gave you on my machine and it did make
the replacement without error. "strFieldName" should be the name of the
field from the Table or Query behind your report.

--
David Lloyd
MCSD .NET
http://LemingtonConsulting.com

This response is supplied "as is" without any representations or warranties.


Ok so I put this into the control source property.

=Replace([strProductName],"&#8482­;",Chr$(169))

Notice I changed the field name

Now I get #error on the report.
 
GOT IT.

I put it into the query as an expression. Also I made one change. I
did a test with the word hello. Here is what I used.

I was replacing &reg

ReplaceTest: Replace([strProductName],"&reg"," hello")

Ended up with a bunch of items with a hello on the end. Notice the
pair of quotes at the end around the replacment content. That was
missing. Now I just have to find what the actual replacement would be.
Also have to figure out how to do it more then once.

Thanks a bunch!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top