Tech or Treat! Write an article about your scariest tech disaster to win gadgets!Learn more

x
?
Solved

script or method to unzip files deposited daily in a folder and load to an access table

Posted on 2012-03-21
4
Medium Priority
?
338 Views
Last Modified: 2012-03-21
Hello,

I have a need to achieve the following:

load information from a file "abc1.dat.zip" into an access database

There is a new file deposited everyday. Presumably the naming convention will be standardized and incremented by 1

The files are not cumulative and, thus, need to be appended to the whatever information is already existing in the database table.

would it be preferable to unzip the files and combine them OUTSIDE of access and link to THAT file

OR...

Unzip the latest file and append that information to the existing access table.

This is a windows environment...

I hope I am explaining this properly and any assistance is greatly appreciated.

Thanks!

PLS
0
Comment
Question by:pls123
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 26

Expert Comment

by:Nick67
ID: 37749358
There's a fair bit of heavy lifting there, much more than is suitable to a single question.
You can use the TextStream object to create new textfiles and the OpenAsTextStream sub method of the FileSystemObject GetFile method to read and write to varying kinds of textfiles.

What type of format is your .dat file and how familiar are you with VBA and the FileSystemObject?
0
 

Author Comment

by:pls123
ID: 37749428
Hi,

The file format is variable length text records with a | delimiter.

I have a very basic familiarity with VBA.  I am not familiar in particiular with the filesystemobject, as usually I am just executing scripts and not writing them.

should I break out the question into multiple parts?
a) unzip files
b)write to a text file
c) automatically import and append a text file to an existing microsoft access table?

Thanks!
0
 
LVL 26

Accepted Solution

by:
Nick67 earned 2000 total points
ID: 37749541
I think you'd have better results from multiple questions, yes.

1) How can I use VBA to unpack a file from a zipfile that gets created in a known file system location?

2) <<This can be straightforward, and you may already know how>> How can I link to a delimited textfile as an Access table?

3) How can I use OpenAsTextStream to append the contents of one text file to another?

#2 can get a little tricky pre-Access 2007 as the linking wizard can mis-label some of the field types.

If you create one single linked table, and append new data to that linked textfile, there won't need to be any appending within Access.  It'll happen when the textfiles get merged.

You should also state what version of Access you are targetting
0
 

Author Comment

by:pls123
ID: 37749605
I know that we are using access 2007.  I will close this question and re-submit as multiple questions.

Thanks!
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
Suggested Courses

647 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question