filelen in a query

T

TTL

Hi
I'm having problems running a query with the function FileLen in it using
access 2003.
This has never been a problem in access 97.
I get an error message - 'undefined function 'FileLen' in expression
can anyone tell me why this is happening?
Thanks
TTL
 
B

Brendan Reynolds

FileLen is one of the functions that are blocked by the new 'sandbox' mode.
You can work around it by writing a VBA function that calls FileLen, and
calling the function from your query instead of calling FileLen directly.

Public Function MyFileLen(ByVal MyPathName As String) As Long
MyFileLen = FileLen(MyPathName)
End Function

SELECT MyFileLen([MyPathName]) FROM MyTable

For more information on sandbox mode, see the following URL ...
http://support.microsoft.com/default.aspx?scid=kb;en-us;294698
 
Top