473,480 Members | 2,324 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Update Access Table with filename, modified file date/time and values contained in these flat files

Hi,

I am using Win2000 and Access2000.

I need to build build a macro or write a VBA in Access that would screen all
files contained in a directory on my C drive (files are structrured DAT
files [flat files]) and update an Access table with the following
information:
(1) Filename (variable lenght)
(2) Modified File Date/Time
(3) Value in field 25: (that alphanumeric value is inside the file and is of
variable lenght)
(4) Date in field 62, second subfield (that value is inside the file). The
date is in format YYMMDD. So for instance, for ":62M:C050608EUR16695,64
", I need to capture 05/06/08

A single file might contain several times a combination of field 25 and
field 62. The table should be updated with each combination. I pasted a
sample of the aforementioned flat file below.

Can anyone advice on where to start? Thanks
Pierre
:20:9400105159192706
:25:00001959026
:28C:112/1
:60F:C050608EUR0,
:61:0506080608CR18,18NTRFNONREF//9991912629
/BAI/195/INCOMING WIRE
:86:/PT/DE/EI/JOHN SMITH GMBH, 1010 WIEN IHR KT 0000012345/20000
12345 NR.1234 /22.04.05/NETTOBTR. xx,xx
:61:0506080608CR34,92NTRFNONREF//9991912631
/BAI/195/INCOMING WIRE
:86:/PT/DE/EI/JOHN SMITH GMBH, 1010 WIEN IHR KT 0000012345/20000
12345 NR.1234 /22.04.05/NETTOBTR. xx,xx
:61:0506080608CR240,95NTRFNONREF//9991912633
/BAI/195/INCOMING WIRE
:86:/PT/DE/EI/JOHN SMITH GMBH, 1010 WIEN IHR KT 0000012345/20000
12345 NR.1234 /22.04.05/NETTOBTR. xx,xx
:61:0506080608CR261,90NTRFNONREF//9991912635
/BAI/195/INCOMING WIRE
:86:/PT/DE/EI/JOHN SMITH GMBH, 1010 WIEN IHR KT 0000012345/20000
12345 NR.1234 /22.04.05/NETTOBTR. xx,xx
:61:0506080608CR357,60NTRFNONREF//9991912637
/BAI/195/INCOMING WIRE
:86:/PT/DE/EI/JOHN DOE 1234567
:61:0506080608CR408,NTRFNONREF//9991912639
/BAI/195/INCOMING WIRE
:86:/PT/DE/EI/JOHN SMITH GMBH, 1010 WIEN IHR KT 0000012345/20000
12345 NR.1234 /22.04.05/NETTOBTR. xx,xx
:61:0506080608CR1127,92NTRFNONREF//9991912641
/BAI/195/INCOMING WIRE
:86:/PT/DE/EI/JOHN SMITH GMBH, 1010 WIEN IHR KT 0000012345/20000
12345 NR.1234 /22.04.05/NETTOBTR. xx,xx
:61:0506080608CR14246,17NTRFNONREF//9991912643
/BAI/195/INCOMING WIRE
:86:/PT/DE/EI/JOHN SMITH GMBH, 1010 WIEN IHR KT 0000012345/20000
12345 NR.1234 /22.04.05/NETTOBTR. xx,xx
:62M:C050608EUR16695,64
:86:/PG/1
:20:9400205159192706
:25:00001959026
:28C:112/2
:60M:C050608EUR16695,64
:61:0506080608DR16695,64NMSC490 0001234567//3377752425
/BAI/577/ZBA DEBIT
:86:/PT/DE/EI/123 1234567891
:62F:C050608EUR0,
:64:C050608EUR0,
:86:/PG/2L
:
Nov 13 '05 #1
1 4449
(1) Filename (variable lenght)

Look up help in Access regarding the FileSearch object With VBA you
can lookup the file names in a directory.

(2) Modified File Date/Time

The LastModified property only allows you to specify a parameter for
filtering.

(3) Value in field 25: (that alphanumeric value is inside the file and
is of
variable lenght)

I'm confused a little here. Is each entry in the file one field?
Based on your sample data, I can't tell.

(4) Date in field 62, second subfield (that value is inside the file).
The
date is in format YYMMDD. So for instance, for ":62M:C050608EUR16695,64
", I need to capture 05/06/08

Again I'm not sure what you mean by subfield. Your explanation might
make sense to you, but I'm confused without seeing the table structure
and the actual data file.

You can do string parsing to strip out the date as long as there is a
common setup for each field. It appears that the comma (,) denotes the
end of the alphanumeric value containing the date you want, so you
could start at the colon behind the number, check for an alpha
character afterwards and then strip out the date using a mid function.

It's very doable, but not easy unless you are good coder.

Sorry I couldn't be more help.

Nov 13 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
3290
by: Jan van Veldhuizen | last post by:
The UPDATE table FROM syntax is not supported by Oracle. I am looking for a syntax that is understood by both Oracle and SqlServer. Example: Table1: id name city ...
3
23991
by: Random Person | last post by:
Does anyone know how to use VBA to relink tables between two MS Access databases? We have two databases, one with VBA code and the other with data tables. The tables are referenced by linked...
9
4331
by: Dom Boyce | last post by:
Hi First up, I am using MS Access 2002. I have a database which records analyst rating changes for a list of companies on a daily basis. Unfortunately, the database has been set up (by my...
6
4705
by: Peter Frost | last post by:
Please help I don't know if this is possible but what I would really like to do is to use On Error Goto to capture the code that is being executed when an error occurs. Any help would be much...
8
3690
by: Maxi | last post by:
There is a lotto system which picks 21 numbers every day out of 80 numbers. I have a table (name:Lotto) with 22 fields (name:Date,P1,P2....P21) Here is the structure and sample data: ...
9
3812
by: Wayne Smith | last post by:
I've come up against a major headache that I can't seem to find a solution for but I'm sure there must be a workaround and I would really be grateful of any help. I'm currently building a web...
3
7149
by: RAMohrmann | last post by:
Greetings, I am attempting to view all files in a directory and if those files have not been modified within the last couple days I will remove them. In order to do this I need to look at the...
4
7208
by: =?Utf-8?B?QmFidU1hbg==?= | last post by:
Hi, I have a GridView and a SqlDataSource controls on a page. The SqlDataSource object uses stored procedures to do the CRUD operations. The DataSource has three columns one of which -...
0
7051
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
6915
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...
0
7054
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,...
0
7097
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...
0
6993
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...
0
3003
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
2993
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1307
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 ...
0
193
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.