Importing Text File into Access

M

Marianne

I need help importing a 50MB file into an Access database. There is pattern
to the data. Each record starts with "STMTS" with a carriage return in front
of it. The carriage return could also be the end of the previous record.
There are 16 fields for each record. I think this can be done by writing code
using VBA, but I cannot get the code right. Please Help! Here is a sample of
the data layout in the txt file.

Thanks!
Marianne

STMTS 9999999-01 Timmy County Horses palomino horses for daffy duck
01-JAN-2004 31-MAR-2004 08-APR-2004 daffy
ducky 999999999 daffy A ducky
1111 American Highway street
AnywhereUSA KY 12345 STMTS 9999998-01
Timmy Country Horse palomino horse for daffys duck
01-JAN-2004 31-MAR-2004 08-APR-2004 daffy duck
888888888 daffy J ducky
123 Halfacre parkway
LEBANON MN 12345 STMTS 9999997-01 Timmy County
Horses palomino horses for daffy ducks 01-JAN-2004
31-MAR-2004 08-APR-2004 goofy smithyys 777777777
mickeys ands minne 5555
sMORES CREEK plat finely
NJ 12345 STMTS 5555555-01 timmy County horses
palomino horses for daffy duck 01-JAN-2004 31-MAR-2004
08-APR-2004 Basin MERRY 444444444 Merry G Basin
222 RTe 666
pagosa springs FL 12345
STMTS .....
 
M

Marshall Barton

Marianne said:
I need help importing a 50MB file into an Access database. There is pattern
to the data. Each record starts with "STMTS" with a carriage return in front
of it. The carriage return could also be the end of the previous record.
There are 16 fields for each record. I think this can be done by writing code
using VBA, but I cannot get the code right.


You could use this to do the job or, at least, see a major
example of how to use File I/O.
http://www.mvps.org/access/modules/mdl0057.htm
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top