Connecting Tech Pros Worldwide Help | Site Map

Preventing mulitple imports of a text file

 
LinkBack Thread Tools Search this Thread
  #1  
Old November 12th, 2005, 06:15 PM
Bob A
Guest
 
Posts: n/a
Default Preventing mulitple imports of a text file

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

  #2  
Old November 12th, 2005, 06:15 PM
DFS
Guest
 
Posts: n/a
Default Re: Preventing mulitple imports of a text file

"Bob A" <robert.aloisio@olympus.com> wrote in message
news:b0546a98.0401190820.4a795119@posting.google.c om...[color=blue]
> 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?[/color]

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.



[color=blue]
> Thanks in advance.
>
> --Bob[/color]


  #3  
Old November 12th, 2005, 06:15 PM
Larry Linson
Guest
 
Posts: n/a
Default Re: Preventing mulitple imports of a text file

"Bob A" wrote
[color=blue]
> 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?[/color]

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


 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,989 network members.