vba - MS Access importing UTF-8 file -


i import several '|' separated files db this:

private sub cmdimport_click()  dim integer dim path1 string  path1 = "c:\importfiles"  destination = "c:\importfiles\processed"  set fs = application.filesearch  fs     .lookin = path1     .filename = "*.*"     if .execute > 0         = 1 .foundfiles.count              docmd.transfertext acimportdelim, "importrps", "tbimportrpstemp", .foundfiles(i), false             filename = .foundfiles(i)             filename = replace(filename, path1, "")              set fs1 = createobject("scripting.filesystemobject")              fs1.movefile path1 & filename, destination & format(now, "yyyyddmmthhmmss") & filename          next     else         msgbox "no files update", vbinformation         exit sub     end if end  me.requery  end sub 

problem is, files in utf-8 while access database i'm working not, imports '' in front of first record , table ends looking this:

type    nmbr    date 100  12312   15082013 

what can import files whitout problem? possible convert file ansi , them import or there better ways? can't manually because files supposed arrive dozens every day.

according http://msdn.microsoft.com/en-us/library/office/ff835958.aspx last parameter of transfertext code page. in windows utf-8 code page 65001.

so, try adding , , 65001 docmd.transfertext line. think should like:

docmd.transfertext acimportdelim, "importrps", "tbimportrpstemp", .foundfiles(i), false, , 650001 

i don't have ability test code right now, believe should work.


Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

jquery - Fancybox - apply a function to several elements -

An easy way to program an Android keyboard layout app -