• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1838
  • Last Modified:

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.
0
OrganicTrade
Asked:
OrganicTrade
  • 6
  • 6
2 Solutions
 
puppydogbuddyCommented:
I think special characters such as the registered trademark symbol ® can be imported if the csv file is encoded in UTF-8 format.
0
 
OrganicTradeAuthor Commented:
How would I encode it that way, or what software could I use to do it?  It's coming from a mySQL database.
0
 
puppydogbuddyCommented:
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.
0
Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

 
OrganicTradeAuthor Commented:
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.
0
 
puppydogbuddyCommented:
If you set up an import specification, you need to use it in the TransferText command.

To build a specification:
from the Table Tab in the Database window, right click, Link Table, select CSV, find the file, OK

An importing wizard is launched. In the bottom left is a button 'Advanced' - select this (this is where you identify utf-8)

A new dialog opens, which is pretty self explanatory - you can select columns, data types etc, then save as a specification. Take a note of the specification - lets say this is called "ABC Link Specification".

Now in your VBA use that as follows:

DoCmd.TransferText acImportDelim, "ABC Link Specification", "tblCSVload", "C:\DATABASE\FRONTIERIMPORT.CSV", False

0
 
OrganicTradeAuthor Commented:
doing the import and selecting UTF-8 in the specification eliminated those characters altogether on import.  It didn't work.
0
 
puppydogbuddyCommented:
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.
0
 
OrganicTradeAuthor Commented:
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.
0
 
puppydogbuddyCommented:
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.
0
 
OrganicTradeAuthor Commented:
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
0
 
puppydogbuddyCommented:
From my research , I am finding out that most of the unicode problems result from incorrect unicode encoding in the source csv file created by the sql server.   This incorrect encoding is encoding that does not meet the iso standard, and makes it impossible for Access to decode even if utf-8 s used for decoding.

So, my advice is to review the encoding in the csv source file and see if you can determine how the encoding needs to be changed so that it meets the iso standard, and be "understood" by utf-8.        
0
 
OrganicTradeAuthor Commented:
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.
0

Featured Post

Granular recovery for Microsoft Exchange

With Veeam Explorer for Microsoft Exchange you can choose the Exchange Servers and restore points you’re interested in, and Veeam Explorer will present the contents of those mailbox stores for browsing, searching and exporting.

  • 6
  • 6
Tackle projects and never again get stuck behind a technical roadblock.
Join Now