Unzip and renamed compressed csv

Is there a way to only get the month and day from this? The file names I am getting do not include the year (they can't make anything too easy). The file names will always look something like this "Log Parser 6-26.zip". My goal is to get this automated to the point, that the everyday users will not have to go into the code and update the month and day manually. If it would be easier, I could add a text field to my form for the user to enter the month and day for today. However, I'm not sure how to get that to transfer through the function either. What do you suggest?

Just like this:

"C:\Data\Log Parser " & Month(Date()) & "-" & Day(Date()) & & ".zip"
 
Also if your filename or path has spaces in it you will probably need to encapsulate it in double quotes
Chr(34) & "C:\Data\Log Parser " & Month(Date()) & "-" & Day(Date()) & & ".zip"& Chr(34)
 
Also if your filename or path has spaces in it you will probably need to encapsulate it in double quotes
Chr(34) & "C:\Data\Log Parser " & Month(Date()) & "-" & Day(Date()) & & ".zip"& Chr(34)
Nope, not in this case.
 
That works perfectly. Thank you so much for your help.

I just have one more question. After I finish running my modules, I would like to clear out my temporary table in the database (TempTable) and clear the temporary folder on my harddrive (DA Data). Can this been done through vb in the database, or does it have to be done manually?

Again, thank you so much for all your help.
 
That works perfectly. Thank you so much for your help.

I just have one more question. After I finish running my modules, I would like to clear out my temporary table in the database (TempTable)

Code:
Currentdb.Execute "Delete * From TempTable", dbFailOnError

and clear the temporary folder on my harddrive (DA Data).
You would need to iterate through the files again and use the Kill method for each.
 
I have another question. My manager recently asked me to house my database on our department's SharePoint site. Before I put the database on SharePoint, it would run through this code in a matter of minutes. After I put the database on SharePoint, all of a sudden, it takes it an hour or more to run through this code. All I did was go into SharePoint and "Add a Document" on a section of the site set up specifically for the database by our administrator. Is there a better way to go about this? I have Access 2007 and am uploading to SharePoint 2010. Could that be the reason? Is there a way to improve the speed of the database on SharePoint? I can't even get it to compact and repair. Any advice you can give would be greatly appreciated.
 
Okay, I have one more question. After I remove the files from my temporary folder, I would like to remove the empty folder. I found code for RmDir, but am having trouble getting it to work. The code I am using is this: RmDir ("C:\Report_Data\Log Parser " & Month(Me.FileDate) & "-" & Day(Me.FileDate))
The only way this will work, is to close the database completely and then re-open it and run this line of code by itself. Is there something I can do to get it to run after all the files inside it have been removed without closing the database? Or, is there a better way to get rid of the empty folder?
 

Users who are viewing this thread

Back
Top Bottom