Solved

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

Posted on 2009-03-31
12
1,549 Views
Last Modified: 2012-05-06
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
Comment
Question by:OrganicTrade
  • 6
  • 6
12 Comments
 
LVL 38

Expert Comment

by:puppydogbuddy
ID: 24035978
I think special characters such as the registered trademark symbol ® can be imported if the csv file is encoded in UTF-8 format.
0
 

Author Comment

by:OrganicTrade
ID: 24038409
How would I encode it that way, or what software could I use to do it?  It's coming from a mySQL database.
0
 
LVL 38

Expert Comment

by:puppydogbuddy
ID: 24039639
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
 

Author Comment

by:OrganicTrade
ID: 24039730
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
 
LVL 38

Accepted Solution

by:
puppydogbuddy earned 500 total points
ID: 24040105
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
 

Author Comment

by:OrganicTrade
ID: 24040947
doing the import and selecting UTF-8 in the specification eliminated those characters altogether on import.  It didn't work.
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 38

Expert Comment

by:puppydogbuddy
ID: 24041094
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
 

Author Comment

by:OrganicTrade
ID: 24051521
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
 
LVL 38

Expert Comment

by:puppydogbuddy
ID: 24052367
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
 

Author Comment

by:OrganicTrade
ID: 24052603
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
 
LVL 38

Assisted Solution

by:puppydogbuddy
puppydogbuddy earned 500 total points
ID: 24055450
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
 

Author Comment

by:OrganicTrade
ID: 24110951
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

Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Join & Write a Comment

Today's users almost expect this to happen in all search boxes. After all, if their favourite search engine juggles with tens of thousand keywords while they type, and suggests matching phrases on the fly, why shouldn't they expect the same from you…
Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now