473,796 Members | 2,560 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Trying to get file attributes from within Access

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
3 11495
Les Desser <Ne*******@dess ergroup.com> wrote in message news:<Pi******* *******@desserg roup.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\ju nk1.txt")
junk1.txt
? filedatetime("c :\temp\junk1.tx t")
5/30/2004 7:04:58 PM
? fileLen("c:\tem p\junk1.txt")
68
? getAttr("c:\tem p\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
Have a look at the following funciton in help
getattr
filelen
filedatetime
--
Terry Kreft
MVP Microsoft Access
"Les Desser" <Ne*******@dess ergroup.com> wrote in message
news:Pi******** ******@dessergr oup.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
In article <Tz************ ********@karoo. co.uk>, Terry Kreft
<te*********@mp s.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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
2690
by: Francis Avila | last post by:
A little annoyed one day that I couldn't use the statefulness of generators as "resumable functions", I came across Hettinger's PEP 288 (http://www.python.org/peps/pep-0288.html, still listed as open, even though it's at least a year old and Guido doesn't seem very hot on the idea). I'm not too sure of its ideas on raising exceptions in generators from outside (although it looks like it might be convenient in some cases), but being able...
7
13407
by: Mark | last post by:
Hello, I have researched and tried every thing I have found on the web, in groups and MS KB articles. Here is what I have. I have a Windows 2000 Domain Controller all service packs and every thing else from windows update. ..NET 1.0 and 1.1 installed on the server. Actually .NET was installed before the server was made a DC.
1
1364
by: Good Enchiladas | last post by:
Is it possible to determine a method's own attributes from within the method without hardcoding the name of the method as a constant within the method? Please tell me if it is possible and how it is done. Thank you, Kelly
3
1742
by: AWasilenko | last post by:
I'm still in the process of learning python via a handful of books I bought. One book I am reading just introduced Base Class Methods. I found that I needed more understanding on this concept and wrote a short test program using the Author's code as a vague reference. My question now really isn't Base Class related, but my question stems from my test code so I will just post it as is. ##Test of Super() stuff class First(object):
3
2046
by: Beorne | last post by:
In the classes I develop my attributes are always private and are exposed using properties. directly or to access the attributes using the properties? Does "wrapper" setter/getter properties introduce time overhead in execution? Thanks, Matteo
6
4930
by: rlntemp-gng | last post by:
I need to extract information from some Excel files but am stuck with part of it: As an example, I have the following Excel File that has 3 tabbed sheets: FileName: C:\ExcelData\JulyFile1.xls SheetName: Sheet1-07032007 RowCount: 325 ColumnCount: 15 SheetName: Sheet2-07102007 RowCount: 450 ColumnCount: 25 SheetName: Sheet3-07172007 RowCount: 625 ColumnCount: 45 (I have 7 other Excel files with similar attributes)
2
9295
by: Viewer T. | last post by:
I am trying to write a script that deletes certain files based on certain criteria. What I am trying to do is to automate the process of deleting certain malware files that disguise themselves as system files and hidden files. When I use os.remove() after importing the os module is raises a Windows Error: Access denied probably because the files have disguised themselves as system files. Is there anway to get adequate privileges under...
4
10329
by: Alvin SIU | last post by:
Hi all, I have 6 tables inside a MS Access 2003 mdb file. I want to convert them as DB2 version -8 tables in AIX 5.2. I have exported them as 6 XML files. The XML files look fine. Each record is embeded by a tag which is the table name.
11
6260
by: Rafe | last post by:
Hi, I'm working within an application (making a lot of wrappers), but the application is not case sensitive. For example, Typing obj.name, obj.Name, or even object.naMe is all fine (as far as the app is concerned). The problem is, If someone makes a typo, they may get an unexpected error due accidentally calling the original attribute instead of the wrapped version. Does anyone have a simple solution for this?
0
9530
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10459
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10236
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10017
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7552
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6793
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5577
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4120
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3734
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.