How to re-load text files into Access?

bimmer5

Registered User.
Local time
Today, 04:03
Joined
Apr 22, 2008
Messages
67
Is there a way to setup Access to flush all data stored and re-load with new data while keeping intact the table structure, queries, etc...?
If so, Access should do it in an automated fashion every night. The reason I am asking is that this new report writer I work with does not work if Access is linked to text files. Linking text files is my favourite way that enables me to update them with new, exported data from accounting system that changes every day. In this case, the data must be stored in Access, but how to refresh the data every day while keeping everything else intact and not to do any manual intervention?
Thank you,
Peter
 
I"m not sure if I understand the problem.

The report writer you are using can't read the text file if Access is linked to it, and you want to break the link to allow the report writer to read the text then re-link the file without any manual intervention?

If this program runs at a scheduled time, you could just automate it within Access using ShellAndWait function (google this), which prior to execution, Acccess would delete the link to the file, and let report writer do its thing, and when it is done, Access can then relink the table. (Google on "programatically relink Access tables" or substituting relink with refresh to get some code snippets to modify for your text files.

Is that what you were looking for?
 
Banana,
I am afraid you didn't get my question...
File linking is not an option at all with this report writer. I am at the beginning of setting up Access data for the first time so there is no file links to break at all. I was told that I have to store data by using "Import table" functionality instead of "Link Table". That's not problem at all, I can do it that way, too. My problem is how to re-import with the new / override old data every day in an automated fashion?
I hope this clarifies what I meant at the first place?
Thank you for your interest in helping me.
 
Well, I suppose it would be just a matter of deleting the old table then re-importing the table? All we would need to make sure is that the file goes to same location where Access can look into for reimporting. I haven't worked with a text file as a source, but I imagine that there are loads of code snippets out there about how to automatically import tables, and you could look for examples using CSV or something like that to get an idea of how it will work out. The import process usually defines the structure, and as long your text file's structure is same, it won't be that bad.
 
Gentlemen,

thank you very much for the advices you gave it to me. I hope I'll make it work.
I appreciate your time and effort in helping me resolve this challenge.
Peter
 

Users who are viewing this thread

Back
Top Bottom