Unanswered: Searching Directories and import files
I need to search a directory on a server the dir is split up into days of the month (eg. //2004/02/01 ect for everyday in the month). In each directory there are about 20 text files with different names that each needs to go into its own table in access. So the ideal will be to enter a directory and for every file thats imported put a flag in the database, so that you can say import //2004/02 and will then scan through all 30 dirs and import all the files.
I am completely new to Access and VB, and don't even now where to start - any help will be appreciated.
Are all of the files in the same format? What kind of format? Fixed length? Delimited? Excel? If they are all in the same format you might think about using DoCmd.TransferText or DoCmd.TransferDatabase. These commands in VBA will help you import each file. But you will need to created a File Specification first.
Before trying to automate the process first try to import or link to the data manually using File|Get External Data|Link or Import. The wizard will walk you through it. Once you get the hang of it with all the options, then look for the Advanced button. There you will be able to set up and save a File Specification. Then you can create a Macro that will link or import a file. Once you have done that then going from a macro to DoCmd.TransferText or DoCmd.TransferDatabase should be pretty easy.
All the files are in the same format - delimited. It is files that gets spooled out every night (reports) from a Unix system. So there is 30/31 directories with each nights files, and all the files of all the days have got the same name. The tables are already created in Access, so the data needs to be appended, and then for every day, for every file that has been imported there should be a flag set because some of the reports are empty. The big problem is that none of the files have got any info on a date. Only the directory structure specifies the date eg. //2004/02/01 next dir will be //2004/02/02 ect.