Un-accent characters

  • Thread starter Thread starter John
  • Start date Start date
J

John

Hi

I need to export data to an app that does not accept accented characters
like é etc. Is there a function in access to un-accent such characters?

Thanks

Regards
 
There is nothing built-in, and, to the best of my knowledge, there is no
fixed relationship between a non-accented character and the various accented
forms of that character. For example ...

? asc("á")-asc("a")
128
? asc("é")-asc("e")
132

What this means is that, as far as I can tell, you would have to write code
to handle each possible accented character individually ...

strWhatever = Replace(strWhatever, "á", "a")
strWhatever = Replace(strWhatever, "é", "e")

etc., etc., etc.

Or walk the string, examining each character in turn, and do something like
....

If Asc(strChar) Between Asc("è") And Asc("ë") Then
strWhatever = strWhatever & "e"
Else If Asc(strChar) Between Asc(""à") And Asc("å") Then
strWhatever = strWhatever & "a"
'etc., etc., etc.
Else
strWhatever = strWhatever & strChar
End If

I can't say for sure, but possibly you may be able to do something with
regular expressions. I have only used regular expressions in .NET, but I
believe it should be possible to use them in VBA by adding a reference to
the Microsoft VBScript Regular Expressions <version number> object library.
There's a very good tutorial and reference on regular expressions at the
following URL ...

http://www.regular-expressions.info/

If you are in a position to do so, the best solution would be to explain to
the vendors of the other application that this is the year 2004, and that
they really need to catch up - they can't go on living in the 1980s for
ever! :-)

--
Brendan Reynolds (MVP)
http://brenreyn.blogspot.com

The spammers and script-kiddies have succeeded in making it impossible for
me to use a real e-mail address in public newsgroups. E-mail replies to
this post will be deleted without being read. Any e-mail claiming to be
from brenreyn at indigo dot ie that is not digitally signed by me with a
GlobalSign digital certificate is a forgery and should be deleted without
being read. Follow-up questions should in general be posted to the
newsgroup, but if you have a good reason to send me e-mail, you'll find
a useable e-mail address at the URL above.
 

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