By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,863 Members | 853 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,863 IT Pros & Developers. It's quick & easy.

Trying to get file attributes from within Access

P: n/a
In A97 I am trying to determine some attributes of files in a folder -
Date, time, file size and file name.

To this end I have managed to create a batch file to do a Dir to a work
file (and then using Shell to run it) and am trying to read back the
contents.

I am using the Input statement but that returns the first part of each
record only up to the first delimiter. So for

18/08/04 04:48 88,217,833 AllData.zip

it just returns "18"

How can I read a full line at a time? I have tried the Input function
but that needs a character count, which gives an error if it is too high
- I am not too keen on stitching bits of the file together.

Alternatively, how else can I get into Access a list of files and
attributes, given a directory path?

(The aim of all this is to record the contents of a directory into a
database, detailing file name, change date/time and file size)

Thanks.
--
Les Desser
(The Reply-to address IS valid)
Nov 13 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Les Desser <Ne*******@dessergroup.com> wrote in message news:<Pi**************@dessergroup.com>...
In A97 I am trying to determine some attributes of files in a folder -
Date, time, file size and file name.

Alternatively, how else can I get into Access a list of files and
attributes, given a directory path?


Access (VBA) has some built-in functions to do some of this. You
can test them in the Immediate window (Ctrl-G):

? dir("c:\temp\junk1.txt")
junk1.txt
? filedatetime("c:\temp\junk1.txt")
5/30/2004 7:04:58 PM
? fileLen("c:\temp\junk1.txt")
68
? getAttr("c:\temp\junk1.txt")
32
? vbArchive
32

Check out the on-line help on these functions. You'll want to
use Dir() to get the list of files in a directory - you can
search this newsgroup using Google Groups for some examples
and additional info.

'---------------
' John Mishefske
'---------------
Nov 13 '05 #2

P: n/a
Have a look at the following funciton in help
getattr
filelen
filedatetime
--
Terry Kreft
MVP Microsoft Access
"Les Desser" <Ne*******@dessergroup.com> wrote in message
news:Pi**************@dessergroup.com...
In A97 I am trying to determine some attributes of files in a folder -
Date, time, file size and file name.

To this end I have managed to create a batch file to do a Dir to a work
file (and then using Shell to run it) and am trying to read back the
contents.

I am using the Input statement but that returns the first part of each
record only up to the first delimiter. So for

18/08/04 04:48 88,217,833 AllData.zip

it just returns "18"

How can I read a full line at a time? I have tried the Input function
but that needs a character count, which gives an error if it is too high
- I am not too keen on stitching bits of the file together.

Alternatively, how else can I get into Access a list of files and
attributes, given a directory path?

(The aim of all this is to record the contents of a directory into a
database, detailing file name, change date/time and file size)

Thanks.
--
Les Desser
(The Reply-to address IS valid)

Nov 13 '05 #3

P: n/a
In article <Tz********************@karoo.co.uk>, Terry Kreft
<te*********@mps.co.uk> Thu, 19 Aug 2004 14:54:43 writes
Have a look at the following funciton in help
getattr
filelen
filedatetime


Thank you to all three of you - Chuck, John and Terry

Just what I was looking for.
--
Les Desser
(The Reply-to address IS valid)
Nov 13 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.