MLH wrote:
I don't believe Access 2.0 had the FileLen function that subsequent version
have. I think there was an API call that could do it, but unfortunately I
don't have a 16 bit API reference anymore.
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Well, even a blind hog can find an acorn sometimes...
Open "c:\mydir\data.fil" For Binary As #1
FileSize = LOF(1)
Close #1
MsgBox CStr(FileSize)
You'd best check it exists first with the Dir() function as opening in
binary mode will create the file if it doesn't and return 0 bytes,
either that or open the file for input.
Another tip is that some other process may have the file open, since all
you want to do is get the size of the file that shouldn't bother you but
the i/o open command opens it with an exclusive lock unless otherwise
specified, e.g.
open "file" for binary access read shared as #1
Bummer if the file is over 2GB though :-)
--
[Oo=w=oO]