本文介绍了文件名中的字符无效的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已将88K文件从Apple Mac传输到Windows PC。 某些文件(大约1000个)的名称中包含无效字符。 我可以手动替换无效字符;但这个过程需要时间。 当我使用Windows资源管理器查看
文件名时,它们内部似乎有子弹字符(即chr(149))。  所以,我转向Access寻求帮助。 在Access中,无效的文件名似乎对其他无效字符有替代问号。 
无效的文件名位于记录集的字段中,然后可以对其进行处理。 使用包含两个文本字段的表单,我尝试了以下内容:

I have transferred 88K files from an Apple Mac to a Windows PC.  Some of the files, approximately 1000, have invalid characters in their names.  I can manually replace the invalid characters; but this process takes time.  When I look at the filenames using Windows Explorer, they appear to have bullet characters within (i.e. chr(149)).  So, I turned to Access for help.  Within Access the invalid filenames appear to have a substitute question mark for the otherwise invalid character.  The invalid filenames are in a field of a record set, which can then be processed.  Using a form with two text fields, I have tried the following:

#Const testRename = False

#Const testGetFile = False

#Const testCopyFile = False

   

    Dim fso As Object

    D f作为对象

    

    Dim strFilename As String

        strFilename = Dir(Me.txtInvalidFilename)

    If(Len(strFilename)> 0)然后
#Const testRename = False
#Const testGetFile = False
#Const testCopyFile = False
   
    Dim fso As Object
    Dim f As Object
    
    Dim strFilename As String
        strFilename = Dir(Me.txtInvalidFilename)
    If (Len(strFilename) > 0) Then

推荐答案

Access是否看到无效字符如同Chr(149),还是完全不同的东西?

Does Access see the invalid character as Chr(149) as well, or something totally different?


这篇关于文件名中的字符无效的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-20 13:28