Imports and Looping

  • Thread starter Thread starter Charles Smythe
  • Start date Start date
C

Charles Smythe

I would like to import an entire folder of text (.txt)
files into a database. I have been told that the only way
to use that is by coding. I am not familiar with the
visual basic language, or coding in general. If anyone
could get me some code or a way to find code which
utilizes the TransferText command and loops through a
folder containing .txt file I would be very greatful.

Thank You
 
In the Access 2000 Developer's Handbook Volume 1 by
Getz, Litwin and Gilbert (page 49), there is an example
of a class module that manipulates text files. You can
import the class module into your database. You then set
the properties and call the methods of the class to
manipulate text files. This means you don't have to know
how the code in the class module works - it does all the
hard work for you. But if, as you say, you don't know much
about vba programming, you might find it daunting. You
will need to combine using the class module with knowing
how to loop through all the files in a folder and writing the
data you've captured into your database. In principle,
it's not difficult but it'll be tough on a beginner to vba as
there's quite a lot to know.

Good luck. Hope this points you in the right direction.
Geoff
 
Back
Top