473,728 Members | 1,947 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Importing "dirty" Excel file into Access

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

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 3608
"nutthatch" <ri*****@184sys tems.com> wrote in message
news:11******** **************@ g44g2000cwa.goo glegroups.com.. .
I want to be able to import an Excel spreadsheet into Access 2K using
the macro command Transferspreads heet.

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*****@184sys tems.com> wrote:
I want to be able to import an Excel spreadsheet into Access 2K using
the macro command Transferspreads heet.

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
11358
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 exit the app, or load a new file, without saving changes that have been made. In MFC/Win32, you'd trap the WM_COMMAND/EN_CHANGE notification messages, etc. But, this doesn't seem to happen in Windows Forms. I tried Spy-ing a windows forms app, and the WM_COMMAND messages don't even get sent...
5
4364
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, combo, listboxes, ...) was changed. Is there a quick and easy way to do this? Thanks in advance. Alain
15
4018
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 that if they close the form, i can ask them if they would like to save there changes. Is there a simple way to do this, or do I have to have code in each text boxes keypress(?) event ?
7
2938
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, but through an imagelist and on a toolbar they all have this blue aura around them. I assume that is from the transparency, but I don't understand why almost any other control displays them properly.. There really is no replacement for the toolbar (without paying!), so I hope someone can tell...
0
8758
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9422
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9277
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9130
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8129
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6716
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6013
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4792
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2663
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.