Solved

Access/SQL ETL (Extract Transfer Load)

Posted on 2014-02-05
3
673 Views
Last Modified: 2014-02-06
Hi

I have an Access database that has tables that are linked to SQL.
On a daily basis the data from one of the tables (circa 40000 rows) has to be
be downloaded into Access, edited and uploaded again.

I was told that the process is referred to as ETL (Extract Transfer Load)
where the linked table is converted into an Access table, the SQL index column is dropped.
Then data is edited and added in Access and finally re-uploaded.

What is the best way to do this? I assume that a mix of VBA and queries will be necessary
0
Comment
Question by:murbro
3 Comments
 
LVL 49

Expert Comment

by:Gustav Brock
ID: 39838151
40000 rows isn't that much, so just create a link (attach) the table via ODBC and manipulate the records. Much easier than importing, deleting, and refilling the table.

/gustav
0
 
LVL 24

Accepted Solution

by:
Bitsqueezer earned 500 total points
ID: 39838345
Hi,

I would also recommend to use Gustav's solution. The reason is that a user would normally edit only one record at a time so the risk of concurrency is relatively small (but you need of course a 100% online connection to the backend). If one user edit the same record as another one, Access handles that automatically and warns you if the record on the server is no longer the same as the own one - no code needed (but you should add a column of type "timestamp" to any table which is edited by Access directly).

If you really need to edit an "offline" version you would need to handle the concurrency on your own. That means: If the user edit 10 records where another user also edited and deleted 6 of them with his own frontend then you need to have a way to handle that when you upload the changes of user 1.

You could use an Access table for that and convert that and so on - but there is a much easier way to do that especially because you have only few records (40,000 is really not much): Use ADO offline recordsets. The trick is simple: Create an ADO recordset and close the connection of the recordset after downloading it. ADO offers a bunch of properties and methods for batch processing so you can easily let the user edit that recordset with a normal Access form by assigning the recordset directly to the form recordset (which can be either DAO or ADO). There are some differences in handling, i.e. the ID column cannot get a new value at the time the user edit it, ADO automatically uses a replacement ID (negative number as far as I remember) and replaces all new record IDs later when the changes are submitted to the server. When the user clicks a "Submit" button, your code can then reenable the connection to the server and use the methods of ADO which offers for example a conflict list that tells you which record was successfully updated and where are which kind of conflicts (like "other user changed that" or "record was already deleted" and so on) and offers methods to handle these conflicts. You only need to program that in VBA because you must say what to do in which conflict case.

Using this method you do not need any local table, no conversion (as you are working with the server's datatypes in the ADO recordset) and no complicate compare methods as that is all already contained in ADO.
By the way: .NET uses a similar technique, only calls that dataset which can hold a bunch of tables but the way is the same: Working always offline, working with the data in memory and having a complete set of conflict methods. If you have learned the batch process handling in ADO you will not have any problem to understand the same in ADO.

Please use your favourite search machine to search for the technical documentation about batch processing in ADO for further details as that would be a lot to explain in detail here.

Cheers,

Christian
0
 

Author Closing Comment

by:murbro
ID: 39838510
Thanks
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Suggested Solutions

I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
JSON is being used more and more, besides XML, and you surely wanted to parse the data out into SQL instead of doing it in some Javascript. The below function in SQL Server can do the job for you, returning a quick table with the parsed data.
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

746 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now