在 access 97 中找到完整路径的目录部分(减去文件名) [英] Find the directory part (minus the filename) of a full path in access 97

查看:22
本文介绍了在 access 97 中找到完整路径的目录部分(减去文件名)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

由于各种原因,我被困在 Access 97 中,只需要获取完整路径名的路径部分.

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

例如名字

c:whatever diranother dirstuff.mdb

应该变成

c:whatever diranother dir

这个网站有一些关于如何做的建议:http://www.ammara.com/access_image_faq/parse_path_filename.html

This site has some suggestions on how to do it: http://www.ammara.com/access_image_faq/parse_path_filename.html

但它们看起来相当可怕.一定有更好的方法吧?

But they seem rather hideous. There must be a better way, right?

推荐答案

你可以做一些简单的事情,例如:Left(path, InStrRev(path, ""))

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

示例:

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

这篇关于在 access 97 中找到完整路径的目录部分(减去文件名)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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