Find the directory part (minus the filename) of a full path in access 97

前端 未结 10 571
太阳男子
太阳男子 2020-12-10 23:38

For various reasons, I\'m stuck in Access 97 and need to get only the path part of a full pathname.

For example, the name

c:\\whatever dir\\another d         


        
10条回答
  •  被撕碎了的回忆
    2020-12-11 00:37

    You can do something simple like: Left(path, InStrRev(path, "\"))

    Example:

    Function GetDirectory(path)
       GetDirectory = Left(path, InStrRev(path, Application.PathSeparator))
    End Function
    

提交回复
热议问题