How do I find the current path (directory) of a MS

2019-04-06 06:30发布

问题:

I am writing VBA within my Access database and I need to reference the containing directory of this database. This path could change since I will be moving the database around.

回答1:

You will want to use the following code:

CurrentProject.Path

This will return a string representing the file path of the current directory.