importing/ exporting

  • Thread starter Thread starter Guest
  • Start date Start date
Sorry my fault I would like to import the csv files automaticly when the
database opens. Can I do this?
 
Yes, you can. Do a manual import once, so an Import Specification is
saved. Then make a macro with a TransferText action (where you will need
the saved Import Spec) and save it as Autoexec. The macro will then run
upon opening the database.

Note: this requires that the .csv file is always named the same, and is
in the same folder. You will also need to take some measures to make
sure you don't import the same file repeatedly. Lots of tricks can be
employed here, like renaming / moving /deleting a file once it's been
imported, or adding a date part in the file name so each is unique etc.
Of course, this goes beyond macros, it takes a little VBA coding, but is
worth your while.

HTH,
Nikos
 
Could you give me a sample code? I have csv files that are broken up by 1
number. example: bb0001.csv, bb0002.csv, etc... they keep add one number.
This is what I want to put in to the database so I can run reports on the
information.
Thank you again.
PP
 
This is what I want to put in to the database so I can run reports on the
information.
In that case, it's getting somewhat more complicated. You need to add
one more foeld in the target table to store the file name each record
came from. This means you cannot do it by means of a simple TransferText
anymore!
There are several ways to do it. I guess I wuld probably forget all
about import specs and trsnsfers and do it all in code through a
recordset operation, if the file is not huge. How many lines usually,
and how many fields in each?

Nikos
 
Dear Nikos,
I am also tring to do almost same thing. i need to import 16 csv in every
hour autometically. all the file will be stored in one folder. but there are
four incremental file name series (like A1,A2,A3,A4. b1,B2...., c1,c2...
every hour)
and i want them to append in 4 table. is it possible? can you give me code
sample?
 
Back
Top