Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

"Microsoft Office Access can't change the working directory to '%USERPROFILE%\<path>'" error message when you start Access 2003 or Access 2002


View products that this article applies to.

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.

↑ Back to the top


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\FolderName.'

    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\FolderName.'

    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\FolderName
    You expect the %USERPROFILE% variable to be resolved to the name of your profile.

↑ Back to the top


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
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%.

↑ Back to the top


Resolution

Important This section, method, or task contains steps that tell you how to modify the registry. However, serious problems might occur if you modify the registry incorrectly. Therefore, make sure that you follow these steps carefully. For added protection, back up the registry before you modify it. Then, you can restore the registry if a problem occurs. For more information about how to back up and restore the registry, click the following article number to view the article in the Microsoft Knowledge Base:
322756 How to back up and restore the registry in Windows


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

  1. Click Start, click Run, type regedit, and then click OK.
  2. Locate, and then click the following registry subkey for your version of Access.
    Access 2003

    HKEY_CURRENT_USER\Software\Microsoft\Office\11.0\Access\Settings


    Access 2002

    HKEY_CURRENT_USER\Software\Microsoft\Office\10.0\Access\Settings
  3. If the Default Database Directory registry value exists, remove it. To do this, follow these steps:
    1. 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?
    2. In the message box, click Yes.
  4. On the Edit menu, point to New, and then click Expandable String Value.
  5. In the New Value #1 box, type Default Database Directory, and then press ENTER.
  6. Right-click Default Database Directory, and then click Modify.
  7. 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.
  8. Click OK.
  9. Locate, and then click the following registry subkey for your version of Access.
    Access 2003

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


    Access 2002

    HKEY_CURRENT_USER\Software\Policies\Microsoft\Office\10.0\Access\Settings
  10. If the Default Database Directory registry value exists, remove it. To do this, follow these steps:
    1. 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?
    2. In the message box, click Yes.
  11. On the Edit menu, point to New, and then click Expandable String Value.
  12. In the New Value #1 box, type Default Database Directory, and then press ENTER.
  13. Right-click Default Database Directory, and then click Modify.
  14. 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.
  15. Click OK.
  16. Quit Registry Editor.

Microsoft Windows 2000

  1. 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.
  2. Locate, and then click the following registry subkey for your version of Access:
    Access 2003

    HKEY_CURRENT_USER\Software\Microsoft\Office\11.0\Access\Settings


    Access 2002

    HKEY_CURRENT_USER\Software\Microsoft\Office\10.0\Access\Settings
  3. If the Default Database Directory registry value exists, remove it. To do this, follow these steps:
    1. In the right pane, click Default Database Directory.
    2. 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?
    3. In the message box, click Yes.
  4. On the Edit menu, click Add Value.
  5. In the Value Name box, type Default Database Directory.
  6. In the Data Type list, click REG_EXPAND_SZ, and then click OK.
  7. In the String box, type the path that you want to use as your default database location. For example, type %userprofile%\My Documents\databases.
  8. Click OK.
  9. Locate, and then click the following registry subkey for your version of Access:
    Access 2003

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


    Access 2002

    HKEY_CURRENT_USER\Software\Policies\Microsoft\Office\10.0\Access\Settings
  10. If the Default Database Directory registry value exists, remove it. To do this, follow these steps:
    1. In the right pane, click Default Database Directory.
    2. 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?
    3. In the message box, click Yes.
  11. On the Edit menu, click Add Value.
  12. In the Value Name box, type Default Database Directory.
  13. In the Data Type list, click REG_EXPAND_SZ, and then click OK.
  14. In the String box, type the path that you want to use as your default database location. For example, type %userprofile%\My Documents\databases.
  15. Click OK.
  16. Quit Registry Editor.

↑ Back to the top


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.
  1. Start the Custom Installation Wizard.
  2. Follow the steps in the Custom Installation Wizard to create a new transform file or to modify an existing transform file.
  3. On the Add/Remove Registry Entries page of the Custom Installation Wizard, click the Add Registry Entry tab, and then click Add.
  4. 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
  5. 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.
  6. Click Add.
  7. 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
  8. 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.
  9. Follow the remaining steps in the Custom Installation Wizard to create your transform file.
For additional information, click the following article number to view the article in the Microsoft Knowledge Base:
208683 "Microsoft Access can't change the working directory to" error message when you start Access
For more information about how to obtain the Custom Installation Wizard, visit the following Microsoft Web site:

↑ Back to the top


Keywords: KB891124, kbprb, kbtshoot, kberrmsg, kbdeployment

↑ Back to the top

Article Info
Article ID : 891124
Revision : 3
Created on : 5/18/2012
Published on : 5/18/2012
Exists online : False
Views : 371