Link to home
Start Free TrialLog in
Avatar of OrganicTrade
OrganicTrade

asked on

registered and trademark symbols not importing correctly into Access from csv file

I have a .csv file that has data in it that contains symbols such as "  © ®
When I either 1) link to the file 2) import the file, Access trashes those characters and replaces them with garbage characters.  How can I get Access to read these correctly?  

Access has no problem with these symbols when they are entered into an Access table, just in .csv files.  I can convert the csv to Excel, and Access can read them but 1) Excel ruins the zip codes and 2) I don't want my end users to have to spend the time converting a bunch of .csv files every two weeks.
Avatar of puppydogbuddy
puppydogbuddy

I think special characters such as the registered trademark symbol ® can be imported if the csv file is encoded in UTF-8 format.
Avatar of OrganicTrade

ASKER

How would I encode it that way, or what software could I use to do it?  It's coming from a mySQL database.
I am sure there are several ways you can do it.  How do you create your csv file.....do you create the csv file by executing the transferText import commands from Access?  If so, one way you can do it is to pass utf-8 for the charSet argment of the transferText method. Another way is to identify utf-8 in an import spec.
The csv is created from a mysql database.  This database is in UTF-8 format from what I can tell.  Our web programmers set up some code (probably in php) on our site that we click on that creates the csv file for us.  I'll check into using and actually import spec in Access, I usually just use the import wizard or link to the csv files.
ASKER CERTIFIED SOLUTION
Avatar of puppydogbuddy
puppydogbuddy

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
doing the import and selecting UTF-8 in the specification eliminated those characters altogether on import.  It didn't work.
Does your access table have the unicode property code setting? Did you type utf-8 with quotes?  If that does not fix, try using utf-8 for the code page argument of the transferText method.
1)There is nothing that I can see in the table properties where I can tell it to have unicode properties.  I do know if you type into any of the tables, including this one, it accepts the " characters.
2) I didn't have to type it, Unicode UTF-8 was an option in a drop down box, both on the import specification, and in creating a macro for the transfer text command.  I think it's safe to assume that if I wrote the VBA code that did the same thing as the macro, the same thing would happen--It eliminates these characters now, instead of replacing them with garbage characters.

If you have any other suggestions, I'd be happy to try, although I might not be able to until the begining of next week.
Are you executing your macro from ms access as an import.?  It would be helpful if you posted it here so that I can see it. If you place your ms access table in design view, the last field property  is the unicode setting.  Check  that again.  In the meantime, I will see if I can find any additional info about the problem you are having.
attached copy of macro, and the field properties.  I have tried setting the Unicode compression to Yes and to No and neither helps.  btw-  I am using Access 2003
macro.JPG
tableprop.JPG
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I found that if I went right into mysql and exported the file directly, then imported it using utf-8, it worked.  So you were right on both accounts, it needed to be imported as utf-8 AND something is up with the way the file is create.