Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Check if file exists in database already

Status
Not open for further replies.

amberH

Programmer
Jun 10, 2002
36
CA
Hi All!
Here's a new question about my database.
Quick summary:
I created a database (with much help from all of you) in Access, that opens a text file out of a directory and pulls all the data into 3 tables. Everything has been working fine, but I'm concerned, and I'm thinking I may need to change how I've set it up.

The way it works right now, it goes through all of the files in the directory, and if a file exists, with a filename which is greater than the last filename in the access database (the filenames are numbers) then it puts the data into Access. This has worked, and will work most of the time. Each new file that is created is one number higher than the previous file.
I just found out that every once in a while this won't be the case. If a file isn't correctly converted into the text file in the first place, it goes elsewhere, someone fixes it, then puts it into the folder with the others. This means that my code may go through the folder when the file isn't there, and grab files that are numbers higher than this one would be, so it will not ever grab it.
I'm really not sure how to deal with this.
I waws thinking of having it check each file in the folder against each file in the database, and if it exists, skip it, if not, convert it.
BUT, this folder just gets bigger and bigger. A lot of time would be wasted by going through every file every day.
Can anyone offer me a suggestion of how to get around this??
THANKS MUCH!!
amber
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top