由于各种原因,我陷入了 Access 97,只需要获取完整路径名的路径部分。
例如名称
c:\whatever dir\another dir\stuff.mdb
应该变成
c:\whatever dir\another dir\
该网站提供了一些有关如何执行此操作的建议: http://www.ammara.com/access_image_faq/parse_path_filename.html
但它们看起来相当丑陋。一定有更好的方法,对吗?
最佳答案
您可以做一些简单的事情,例如:Left(path, InStrRev(path, "\"))
示例:
Function GetDirectory(path)
GetDirectory = Left(path, InStrRev(path, Application.PathSeparator))
End Function
关于vba - 在 access 97 中查找完整路径的目录部分(减去文件名),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/418622/