Export MS Access Memo field and convert Unicode

本小妞迷上赌 提交于 2019-12-19 11:49:10

问题


I have an Access 2003 database. A table has a Memo field and I'm having issues with getting that data out.

  • Exporting that field to a txt or csv chops that field off (255 characters)
  • Exporting as Excel gives me strange characters for linebreaks
  • Appending to a mysql database via myODBC gives an error about "incorrect string"
  • Using VBA with Scripting.FileSystemObject doesn't work unless you tell it to create the file as Unicode, which is okay, but then I can't get the file converted to something I can import

There are Unicode characters in some of my data. It's not a multi-linual database, so the only ones I can find are slanted quotes, probably copied in from Word. Dropping them is fine; the information in the fields will still be understandable.

Can I convert these Unicode characters to their (ANSI? ASCII?) equivalents? I've not dealt with encodings very much.

I tried playing around with iconv, but without knowing anything about the encoding, it didn't really help.

Right now, I need help on: - converting the characters in my database so they export non-unicode-ish-ly - OR, converting the unicode characters after the file has been exporting.


回答1:


The file created by Access/VBA is UTF-16. For some reason, there is a character at the beginning of the file that was causing the Ruby YAML library to parse wrongly.

iconv to the rescue!

iconv -f UTF-16 -t ASCII -c utf_file.yml > ascii_file.yml



回答2:


How are you exporting? Have defined an export spec? In Access 2003, this gives you a dropdown list with all the usual encodings (code pages), including Unicode UTF8. This is also how you define your memo field as having a length greater than 255 characters.




回答3:


Export to .xml



来源:https://stackoverflow.com/questions/727583/export-ms-access-memo-field-and-convert-unicode

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!