When Microsoft Office Access 2003 runs in sandbox mode, expressions that use unsafe functions and properties are blocked. In Access, an expression can be used in many different places — for example, in a calculated field in a query or property sheet, in macro action arguments, or even in certain table properties. Unsafe functions and properties are those that could be exploited by malicious users to access drives, files, or other resources for which they do not have authorization. When Access is running in sandbox mode, expressions that use these functions and properties will result in an error message being displayed.
For more information about sandbox mode, see the topic About Microsoft Jet Expression Service sandbox mode.
The following functions are those for which the Access product team has found legitimate calls in an expression in customer databases. However, they are blocked when the Jet Expression Service is configured to run in sandbox mode:
CurDirCurDir$EnvironEnviron$
For a complete list of blocked functions, and for more information on how to configure sandbox mode for functions, see the article How to configure Jet 4.0 to prevent unsafe functions from running in Access 2003.
These functions cannot be used or referenced in expressions when Access is operating in sandbox mode, but they can be used in Microsoft Visual Basic for Applications (VBA) code. To enable the CurDir and Environ functions in expressions or SQL statements, add the following code to a code module in the Visual Basic Editor in Access:
Public Function CurDir(Optional Drive As String)
CurDir = VBA.CurDir(Drive)
End Function
Public Function Environ(Expression)
Environ = VBA.Environ(Expression)
End Function
The following properties are those for which the Access product team has found legitimate use in an expression in customer databases. However, they are blocked when the Jet Expression Service is configured to run in sandbox mode. For a complete list of blocked properties, and for more information about how to configure sandbox mode for Access properties, see the article How to configure Jet 4.0 to prevent unsafe functions from running in Access 2003. These properties cannot be used or referenced in expressions, but they can be used in VBA code:
Form.RecordSet.RecordCountForm.RecordSetClone.RecordCount
For more information about how to troubleshoot sandbox mode, including how to identify and fix the expressions that are blocked in sandbox mode, see the article Frequently asked questions about Access security warnings.