By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,985 Members | 1,776 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,985 IT Pros & Developers. It's quick & easy.

Preventing mulitple imports of a text file

P: n/a
I do a weekly import of data from two text files, using two schema
files. I have automated the import process that gets the data from the
two files using a macro, and everything works great.

Every week the files are manually replaced by two new files of the
same name.

I would like to put a failsafe to prevent the files from being
imported more than once. Is there an easy way to accomplish this?
Perhaps automatically deleting the file after it is imported?

Thanks in advance.

--Bob
Nov 12 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
DFS
"Bob A" <ro************@olympus.com> wrote in message
news:b0**************************@posting.google.c om...
I do a weekly import of data from two text files, using two schema
files. I have automated the import process that gets the data from the
two files using a macro, and everything works great.

Every week the files are manually replaced by two new files of the
same name.

I would like to put a failsafe to prevent the files from being
imported more than once. Is there an easy way to accomplish this?
Perhaps automatically deleting the file after it is imported?
That would work. Use the Kill command to delete the text file, or FileCopy
to a new name (eg XXXXX_imported.txt), then Kill the original.

Thanks in advance.

--Bob

Nov 12 '05 #2

P: n/a
"Bob A" wrote
I would like to put a failsafe to prevent
the files from being imported more than
once. Is there an easy way to accomplish this?
Perhaps automatically deleting the file after
it is imported?


If you choose this, be sure to manually verify that the import worked and
didn't fail on some records before you delete the file.

I think, if I were doing this, I'd probably just move the file to a
different folder and append the date to its name (so it wouldn't conflict
with the other history files I was keeping there). See CopyFile, FileCopy,
MoveFile, Kill, and Rename statements in Access VBA Help if you want to
automate in VBA. I use macros so little that I don't attempt to discuss
macro techniques unless they are "patently obvious" to me.

Larry Linson
Microsoft Access MVP
Nov 12 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.