?
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
?
333 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

Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

Question has a verified solution.

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

In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
Suggested Courses

752 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