Solved

Data Truncation importing Excel spreadsheet into Access 2010

Posted on 2011-09-02
8
2,410 Views
Last Modified: 2016-10-24
Trying to import an excel spreadsheet into a new Access 2010 database.

First I create the fields and make sure they are all memo.

But I get truncation anyway.

See attached.  Why can't I make the memo field bigger than 255 characters?
 MemoSizeInAccess2010.pdf

Thanks.
0
Comment
Question by:gateguard
  • 2
  • 2
  • 2
  • +2
8 Comments
 
LVL 92

Expert Comment

by:Patrick Matthews
Comment Utility
>>Why can't I make the memo field bigger than 255 characters?

It's a fundamental limitation of the product: the Excel import method truncates at 255 characters.

You will have to use VBA code to bypass this.
0
 
LVL 47

Expert Comment

by:Dale Fye (Access MVP)
Comment Utility
What you are seeing in the Access options window reflects two entirely different characteristics of the database.  
The "Default field type" and "Default text field size" are mutually exclusive (they do not relate to each other).  

The "Default field type" is just that.  When you create a new field in a table, it will automatically default to whatever datatype you have selected in this combo box.

The "Default text field size" is the length that will be assigned to text fields whenever you specify that a field is a Text field.  I generally set mine to 50.

As to the truncation of data, Patrick's recommendation to us VBA code is the only way I have found around this shortcoming as well.  The challenge there is making sure that each row in your Excel speadsheet contains a unique field that can be used to iterate through the rows of the spreadsheet to capture your long strings and insert them back into the Access table.

0
 

Author Comment

by:gateguard
Comment Utility
matthewspatrick, fyed, that makes sense, that it has to be done through VBA code (and thanks fyed for the explanation of the options window).

I am sure both of you are right but is there some link to a Microsoft Technet page (or other page) that definitely says this.

I'm not questioning you, but I'd like to have the source document for my records.

Thanks... and thanks again.
0
 
LVL 74

Assisted Solution

by:Jeffrey Coachman
Jeffrey Coachman earned 166 total points
Comment Utility
http://support.microsoft.com/kb/839785
http://support.microsoft.com/kb/189897
http://social.msdn.microsoft.com/forums/en-US/vsto/thread/4ba977d2-aaf9-4c26-bfa4-59ce3c081098/

It is also *somewhat* of a limit of the sheet
See the Excel help file under: Excel specifications and limits:
<Column width  255 characters >

You can also Google "Excel 255 limit" for many other links to "Verify" this for yourself or your supervisors...
;-)

Jeff
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 92

Accepted Solution

by:
Patrick Matthews earned 167 total points
Comment Utility
I have to backtrack a bit, for Access 2010 at least.

I just tried this successfully in Access 2010...

1) Created an Excel file with dummy data, and the last column containing up to 500 characters

2) I made extra sure that the very first data row contained 500 characters

3) I imported the data into Access

4) I confirmed that the table design marked the column as type memo, and that a query run against that column returns the correct lengths

So, the moral seems to be, make sure that your very first value contains the proper amount of text :)
0
 
LVL 47

Assisted Solution

by:Dale Fye (Access MVP)
Dale Fye (Access MVP) earned 167 total points
Comment Utility
Patrick,

You make a great point, but I think Access actually evaluates the first 25 records to determine datatype when creating a new table in Access.  I saw this in an article in Access Advisor a number of years ago, and if I recall, it showed a method to expand that beyond 25 rows.  You would think that when importing to an already existing table, it would simply use the appropriate datatype and do the appropriate type conversion.

It's one of the things I hate about importing from Excel.  Microsoft has decided that they can figure out the datatype of the field better than we can, and gives us no way to define the import specification of an Excel file.
0
 

Author Closing Comment

by:gateguard
Comment Utility
I ended up creating the table structure in advance, in Access, and on the memo field clearing the @ sign on the format option.  Then the truncation ended.
0
 

Expert Comment

by:Rathan Prithvi
Comment Utility
Hey  i have some problem Row truncartion error it will Occures in Access so please Advise  What should i do?
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

A little background as to how I came to I design this code: Around 5 years ago I designed an add-in that formatted Excel files to a corporate standard, applying different cell colours and font type depending on whether the cells contained inputs,…
Outlook Free & Paid Tools
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.

763 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

6 Experts available now in Live!

Get 1:1 Help Now