Unanswered: How to export multilanguage Unicode records to multiple text files - Unsolved
I have not been able to find a solution to these two issues for months.
1) My Table "UNIVERSITIESOtherName" is made of two columns ID, UniversityOther (university names in non-english characters):
87 "Երևանի ""Հայբուսակ"" Համալասարան"
190 جامعة الخليج العربي
191 الجامعة الخليجیة
192 جامعة البحرين
237 Белорусский государственный экономический университет
I need to export them to multiple text files each named as ID.txt and containing the UniversityOther cell content.
I tried with the module below but I get ?????????? characters instead of the original ones.
I guess I have to somehow tell the vba script to set/convert the characters to Unicode UTF-8 and/or to use a previously saved Export Specification Schema.
Here the Function code I am using at the moment:
Dim rst As DAO.Recordset
Dim x As String
Set rst = CurrentDb.OpenRecordset("SELECT * FROM UNIVERSITIESOtherName")
Do Until rst.EOF
x = FreeFile
Open "C:\temp\" & rst!ID & ".txt" For Append As x
Print #x, rst!UniversityOther
Set rst = Nothing
The question is how to modify the above VBA script function to properly display unicode UTF-8 characters in the exported text files?
2) The second minor problem is that whenever i run the above Export Function module, content is appended to the previous one instead of being replaced
So I get ID.txt files containing several lines of question marks depending on how many times i run the module script:
How can I modify the above script so that it replaces the existing content instead of appending to it?
Thank you very much for your time and suggestions.