为MS Access 2007中的记录创建目录

问题描述:

是否可以为Access 2007中的单个记录创建目录文件夹.例如

Is it possible to create a directory folder for individual records in Access 2007. For example

tblUser
ID
firstName
surName

添加记录时,将创建一个文件夹C:\ userdatabase \ Surname,firstName,ID

When adding a record, would create a folder C:\userdatabase\Surname,firstName,ID

例如在需要将大量图像/文件与记录关联的情况下,这可能会很有用. Access将为每个记录创建并链接到目录.

Could see this being useful in situations for example where a large amount of images/files would need to be associated with a record. Access would create and link to a directory for each record.

预先感谢您的任何建议

Noel

您可以使用VBA MkDir 语句创建目录.

You can use the VBA MkDir statement to make a directory.

例如,如果您要创建一个名称与您的ID值之一匹配的文件夹,作为存储数据库的目录下的子文件夹,则可以使用以下代码:

For example if you want to create a folder whose name matches one of your ID values, as a sub folder under the directory where your database is stored, you could use this code:

MkDir CurrentProject.Path & "\" & ID