Microsoft KB Archive/891124

= &quot;Microsoft Office Access can't change the working directory to '%USERPROFILE%\ '&quot; error message when you start Access 2003 or Access 2002 =

Article ID: 891124

Article Last Modified on 12/20/2004

-

APPLIES TO


 * Microsoft Office Access 2003
 * Microsoft Office Professional Edition 2003
 * Microsoft Access 2002 Standard Edition
 * Microsoft Office XP Standard Edition

-





Important This article contains information about modifying the registry. Before you modify the registry, make sure to back it up and make sure that you understand how to restore the registry if a problem occurs. For information about how to back up, restore, and edit the registry, click the following article number to view the article in the Microsoft Knowledge Base:

256986 Description of the Microsoft Windows Registry



SUMMARY
''After you deploy Microsoft Office Access 2003 or Microsoft Access 2002, users in your organization receive an error message every time that they start Access. If those users click OK in the error message box, Access starts successfully.

This issue occurs if you use the %USERPROFILES% environment variable to configure the location where Access stores database files. Access 2003 and Access 2002 cannot successfully resolve this environment variable. Access 2003 and Access 2002 generate standard REG_SZ registry values when you specify the default database path. Therefore, the %USERPROFILES% environment variable is not successfully resolved to the currently logged on user.

To successfully resolve this environment variable, Access requires the REG_EXPAND_SZ registry type. This article describes how to modify Access 2003 and Access 2002 to use the REG_EXPAND_SZ registry type. This article describes the methods to modify Access in both Microsoft Windows XP and Microsoft Windows 2000.''



SYMPTOMS
When you start Microsoft Office Access 2003, or when you start Microsoft Access 2002, you experience all the following symptoms:  You receive one of the following error messages:

Access 2003

Microsoft Office Access can't change the working directory to '%userprofile%\My Documents\ .'

Verify that the drive is valid and the path is 260 characters or less in length.

Access 2002

Microsoft Access can't change the working directory to '%userprofile%\My Documents\ .'

Verify that the drive is valid and the path is 260 characters or less in length.

 If you click OK, Access starts successfully. If you click Options on the Tools menu, and then you click the General tab, you notice information that is similar to the following in the Default database folder box:

%userprofile%\My Documents\ 

You expect the %USERPROFILE% variable to be resolved to the name of your profile.



CAUSE
This problem occurs if you specify the %USERPROFILE% environment variable as part of the default database folder path in Access. For example, this problem occurs if the following conditions are both true:  You install Access 2003 or Access 2002 by using a transform file (.mst). You set the Default database folder option in that transform file by specifying a path that contains the %USERPROFILE% variable. For example, this problem occurs if you type the following path in the Default database folder box on the Change Office User Settings page in the Custom Installation Wizard:

%userprofile%\My Documents\databases

</li></ul>

Note This problem only affects Access 2003 and Access 2002. This problem does not occur when you specify the %USERPROFILE% variable in a folder path for other programs such as Microsoft Office Excel 2003.

This problem occurs because Access 2003 and Access 2002 generate standard REG_SZ registry values when you specify the default database path by using the Options dialog box in Access or by using a policy. Other Microsoft Office 2003 programs or other Microsoft Office XP programs generate REG_EXPAND_SZ registry values instead. The REG_EXPAND_SZ registry value type can resolve environment variables such as %USERPROFILE%.

<div class="resolution_section">

RESOLUTION
Warning If you use Registry Editor incorrectly, you may cause serious problems that may require you to reinstall your operating system. Microsoft cannot guarantee that you can solve problems that result from using Registry Editor incorrectly. Use Registry Editor at your own risk.

To resolve this problem, modify the Default Database Directory registry values to use the REG_EXPAND_SZ value type. To do this, follow the steps for your operating system.

Microsoft Windows XP
<ol> Click Start, click Run, type regedit, and then click OK.</li> Locate, and then click the following registry subkey for your version of Access.

Access 2003

Access 2002

</li> If the Default Database Directory registry value exists, remove it. To do this, follow these steps: <ol style="list-style-type: lower-alpha;"> In the right pane, right-click Default Database Directory, and then click Delete. You receive the following message:

Are you sure you want to delete this value?

</li> In the message box, click Yes.</li></ol> </li> On the Edit menu, point to New, and then click Expandable String Value.</li> In the New Value #1 box, type Default Database Directory, and then press ENTER.</li> Right-click Default Database Directory, and then click Modify.</li> In the Value data box, type the path that you want to use as your default database location. For example, type %userprofile%\My Documents\databases .</li> Click OK.</li> Locate, and then click the following registry subkey for your version of Access.

Access 2003

Access 2002

</li> If the Default Database Directory registry value exists, remove it. To do this, follow these steps: <ol style="list-style-type: lower-alpha;"> In the right pane, right-click Default Database Directory, and then click Delete. You receive the following message:

Are you sure you want to delete this value?

</li> In the message box, click Yes.</li></ol> </li> On the Edit menu, point to New, and then click Expandable String Value.</li> <li>In the New Value #1 box, type Default Database Directory, and then press ENTER.</li> <li>Right-click Default Database Directory, and then click Modify.</li> <li>In the Value data box, type the path that you want to use as your default database location. For example, type %userprofile%\My Documents\databases .</li> <li>Click OK.</li> <li>Quit Registry Editor.</li></ol>

Microsoft Windows 2000
<ol> <li>Click Start, click Run, type regedt32, and then click OK.

Note You must use the Regedt32.exe Registry Editor tool to create a registry value of the type REG_EXPAND_SZ.</li> <li>Locate, and then click the following registry subkey for your version of Access:

Access 2003

Access 2002

</li> <li>If the Default Database Directory registry value exists, remove it. To do this, follow these steps: <ol style="list-style-type: lower-alpha;"> <li>In the right pane, click Default Database Directory.</li> <li>On the Edit menu, click Delete. You receive the following message:

Registry Editor will delete the currently selected value entry. Do you want to continue the operation?

</li> <li>In the message box, click Yes.</li></ol> </li> <li>On the Edit menu, click Add Value.</li> <li>In the Value Name box, type Default Database Directory .</li> <li>In the Data Type list, click REG_EXPAND_SZ, and then click OK.</li> <li>In the String box, type the path that you want to use as your default database location. For example, type %userprofile%\My Documents\databases .</li> <li>Click OK.</li> <li>Locate, and then click the following registry subkey for your version of Access:

Access 2003

Access 2002

</li> <li>If the Default Database Directory registry value exists, remove it. To do this, follow these steps: <ol style="list-style-type: lower-alpha;"> <li>In the right pane, click Default Database Directory.</li> <li>On the Edit menu, click Delete. You receive the following message:

Registry Editor will delete the currently selected value entry. Do you want to continue the operation?

</li> <li>In the message box, click Yes.</li></ol> </li> <li>On the Edit menu, click Add Value.</li> <li>In the Value Name box, type Default Database Directory .</li> <li>In the Data Type list, click REG_EXPAND_SZ, and then click OK.</li> <li>In the String box, type the path that you want to use as your default database location. For example, type %userprofile%\My Documents\databases .</li> <li>Click OK.</li> <li>Quit Registry Editor.</li></ol>

<div class="moreinformation_section">

MORE INFORMATION
If you use the Microsoft Office Custom Installation Wizard to configure a transform file to modify your Office installation, you can configure the Default Database Directory registry values by using the Custom Installation Wizard. To do this, follow these steps.

Note These steps describe how to configure the Default Database Directory registry values by using the Microsoft Office 2003 Custom Installation Wizard. If you use a different version of the Custom Installation Wizard, you may have to modify these steps accordingly. <ol> <li>Start the Custom Installation Wizard.</li> <li>Follow the steps in the Custom Installation Wizard to create a new transform file or to modify an existing transform file.</li> <li>On the Add/Remove Registry Entries page of the Custom Installation Wizard, click the Add Registry Entry tab, and then click Add.</li> <li>In the Root list, leave the default option HKEY_CURRENT_USER selected, click REG_EXPAND_SZ in the Data type list, and then type the key for your version of Office in the Key box:

Office 2003

Software\Microsoft\Office\11.0\Access\Settings

Office XP

Software\Microsoft\Office\10.0\Access\Settings

</li> <li>In the Value name box, type Default Database Directory, type the path that you want to use as the default database folder in Access, and then click OK. For example, type %userprofile%\My Documents\databases in the Value data box.

Note This path must be a valid path. The destination folder must exist on the client computer.</li> <li>Click Add.</li> <li>In the Root list, leave the default option HKEY_CURRENT_USER selected, click REG_EXPAND_SZ in the Data type list, and then type the key for your version of Office in the Key box:

Office 2003

Software\Policies\Microsoft\Office\11.0\Access\Settings

Office XP

Software\Policies\Microsoft\Office\10.0\Access\Settings

</li> <li>In the Value name box, type Default Database Directory, type the path that you want to use as the default database folder in Access, and then click OK. For example, type %userprofile%\My Documents\databases in the Value data box.

Note This path must be a valid path. The destination folder must exist on the client computer.</li> <li>Follow the remaining steps in the Custom Installation Wizard to create your transform file.</li></ol>

For additional information, click the following article number to view the article in the Microsoft Knowledge Base:

208683 &quot;Microsoft Access can't change the working directory to&quot; error message when you start Access

For more information about how to obtain the Custom Installation Wizard, visit the following Microsoft Web site:

http://www.microsoft.com/office/ork/2003/tools/BoxA03.htm

Additional query words: ACC 2003

Keywords: kberrmsg kbtshoot kbprb kbdeployment KB891124

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.