472,352 Members | 1,617 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,352 software developers and data experts.

Importing "dirty" Excel file into Access

I want to be able to import an Excel spreadsheet into Access 2K using
the macro command Transferspreadsheet.

However, the file I am importing (over which I have no control)
contains some records that are "dirty" i.e. the field contents do not
comply with the expected format (date/time) and they end up in a
seperate table of import errors. (The records in "error" are actually
empty fields.)

This is a regular event and I do not want to have to manipulate the
Excel spreadsheet before I import it.

I want to be able to import all the data into a table and then "clean"
it up using an update query according to standard parameters.

Any suggestions would be appreciated

Richard

Nov 13 '05 #1
2 3459
"nutthatch" <ri*****@184systems.com> wrote in message
news:11**********************@g44g2000cwa.googlegr oups.com...
I want to be able to import an Excel spreadsheet into Access 2K using
the macro command Transferspreadsheet.

However, the file I am importing (over which I have no control)
contains some records that are "dirty" i.e. the field contents do not
comply with the expected format (date/time) and they end up in a
seperate table of import errors. (The records in "error" are actually
empty fields.)

This is a regular event and I do not want to have to manipulate the
Excel spreadsheet before I import it.

I want to be able to import all the data into a table and then "clean"
it up using an update query according to standard parameters.

Any suggestions would be appreciated

Richard

Importing dirty spreadsheets is never much fun. After trying a number of
different solutions my favourite is to use Excel automation. It is not the
fastest, but it gives you the most flexibility when you are cannot rely on
the data format. Other solutions, eg creating linked tables can be quick if
the data is consistent, but if not, I open the spreadsheet and go through
each cell importing the data into a 'plain' text table (that is, each field
is text, not indexed, not required, 255 long).
That is the first stage, after which you can go about trying to convert data
into its proper format and writing the logic which decides what to do when
someone from Human Resources has written 'no idea' in the date of birth
column. Your import routine could either write the record to an 'errors
table' and say the record can't be imported or delete the value, show a
warning but still import the record.
At the end of the day, there is no single standard solution and the more
time you put into your import routine, the better it will be.

Nov 13 '05 #2
On 17 May 2005 08:54:04 -0700, "nutthatch" <ri*****@184systems.com> wrote:
I want to be able to import an Excel spreadsheet into Access 2K using
the macro command Transferspreadsheet.

However, the file I am importing (over which I have no control)
contains some records that are "dirty" i.e. the field contents do not
comply with the expected format (date/time) and they end up in a
seperate table of import errors. (The records in "error" are actually
empty fields.)

This is a regular event and I do not want to have to manipulate the
Excel spreadsheet before I import it.

I want to be able to import all the data into a table and then "clean"
it up using an update query according to standard parameters.

Any suggestions would be appreciated

Richard


One trick that works well is to make sure the top row is all dirty, so Access
thinks all the columns must be text. Then, you can run queries to detect
problems and do data clean-up, delete the junk row, then use an append query
to copy the cleaned data into a final destination table if you need the data
in correctly typed columns.
Nov 13 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Dave | last post by:
How do I check in a Windows Forms app if any controls have changed? I have a form that collects data, and I want to prompt the user if they try to...
5
by: Alain Filiatrault | last post by:
Hi, I need to implement a "form.dirty" feature on a VB .NET form not related to a database. I need to know if any of the items (Textboxes,...
15
by: aussie rules | last post by:
Hi, I have some really, really large forms with dozens of text boxs. What I want to do is somehow know that the user has edited a text box, so...
7
by: Mitchell Vincent | last post by:
I've been trying to get a standard toolbar to play nice with some nice icons that I have. When I put them on a button or anything they look perfect,...
1
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge...
0
jalbright99669
by: jalbright99669 | last post by:
Am having a bit of a time with URL Rewrite. I need to incorporate http to https redirect with a reverse proxy. I have the URL Rewrite rules made...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was...
0
by: Arjunsri | last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the...
0
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand....
0
by: Rahul1995seven | last post by:
Introduction: In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.