Microsoft Access TransferText函数:代码页问题 [英] Microsoft Access TransferText function: problem with codepage

查看:162
本文介绍了Microsoft Access TransferText函数:代码页问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我继承了一个庞大而庞大的MS Access数据库,并被分配来解决其中的问题.问题如下...

I inherited a huge, bulky MS Access database and am assigned to solve a problem in it. The problem is as follow...

系统A将其数据导出到管道分隔的.txt文件中.这些文件中的特殊字符可以正常工作,例如,在记事本或Excel中打开该文件时,将显示值Müller".

System A exports its data to a pipeline-delimited .txt file. The files has special characters working correctly, for example the value "Müller" shows when opening this file in notepad or Excel.

接下来,Access DB导入.txt文件并将结果存储在内部employee表中.姓氏字段的数据类型为"memo".将数据从.txt文件导入到MS Access的方法如下:

Next, the Access DB imports the .txt file and stores the result in an internal employees table. The last name field is of data type "memo". The method to import data from the .txt file to MS Access is as follow:

Call DoCmd.TransferText(acImportDelim, _
                        "tblEmployees", _
                        "tblEmployees", _
                        me.txtImportFile, _
                        True)

运行此导入并查看employees表后,我注意到带有特殊字符的名称被弄乱了.例如,Müller"变成M├⌐ller".我调查了一些联机帮助,发现在TransferText调用中可以包含"codepage"参数,因此我将其设置为65001(表面上是unicode的代码页):

After running this import and viewing the employees table I noticed that names with special characters are screwed up. "Müller" becomes "M├⌐ller" for example. I investigated some online help and found out that can include a "codepage" parameter in the TransferText call, so I set it to 65001 (which appearantly is the codepage for unicode):

Call DoCmd.TransferText(acImportDelim, _
                        "tblEmployees", _
                        "tblEmployees", _
                        me.txtImportFile, _
                        True, _
                        , _
                        65001)

现在,我再次运行了导入脚本,我发现没有任何区别,特殊字符仍然变形.我已经精疲力尽了,所以我希望你们中的一些人能就如何解决这个问题提供一些建议...

Now that I have ran the import script again, I see no difference whatsoever, the special characters are still misformed. I'm running out of steam so I hope one of you has some advise on how to resolve this...

推荐答案

TransferText操作的两个版本都使用名为tblEmployees的SpecificationName.该规范中指定了什么代码页?

Both versions of your TransferText operation are using a SpecificationName named tblEmployees. What Code Page is specified in that Specification?

尝试手动导入文本文件.从导入文本向导中选择高级".然后在代码页"列表框中选择"Unicode".您可能需要测试不同的代码页"选择,直到找到正确导入文本的选项.

Try importing the text file manually. Choose "Advanced" from the Import Text Wizard. Then select Unicode in the Code Page list box. You may need to test with different Code Page selections until you find which one imports your text correctly.

选择代码页"的任何方式都可以,将您的选择另存为规范,并在TransferText命令中使用它,而无需提供单独的CodePage参数.

Which ever Code Page selection works, save your choices as a specification and use it in your TransferText command, without supplying a separate CodePage parameter.

这篇关于Microsoft Access TransferText函数:代码页问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆