SetDefaultWorkgroupFile 方法 (访问)Application.SetDefaultWorkgroupFile method (Access)

将默认的工作组文件设置为指定文件。Sets the default workgroup file to the specified file.


表达式SetDefaultWorkgroupFile(路径)expression.SetDefaultWorkgroupFile (Path)

expression:表示 Application 对象的变量。expression A variable that represents an Application object.


名称Name 必需/可选Required/Optional 数据类型Data type 说明Description
路径Path 必需Required StringString 要用作默认文件的工作组文件的完整路径和文件名。The full path and file name of the workgroup file to use as the default.

返回值Return value



如果 Path 所指定的文件不存在,则会发生错误。If the file specified by Path does not exist, an error occurs.


下面的示例将默认的工作组文件设置为目录 C:\Documents and Settings\Wendy Vasse\Application Data\Microsoft\Access 下的 system.mdw 文件。The following example sets the default workgroup file to the file system.mdw in the directory C:\Documents and Settings\Wendy Vasse\Application Data\Microsoft\Access.

Application.SetDefaultWorkgroupFile _ 
 Path:="C:\Documents and Settings\Wendy Vasse\" _ 
 & "Application Data\Microsoft\Access\system.mdw"

支持和反馈Support and feedback

有关于 Office VBA 或本文档的疑问或反馈?Have questions or feedback about Office VBA or this documentation? 请参阅 Office VBA 支持和反馈,获取有关如何接收支持和提供反馈的指南。Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.