Solved

Data Truncation importing Excel spreadsheet into Access 2010

Posted on 2011-09-02
8
2,480 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
ID: 36473451
>>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)
ID: 36473504
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
ID: 36473624
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
ID: 36473802
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
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 
LVL 92

Accepted Solution

by:
Patrick Matthews earned 167 total points
ID: 36473845
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
ID: 36473895
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
ID: 36474515
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
ID: 41856863
Hey  i have some problem Row truncartion error it will Occures in Access so please Advise  What should i do?
0

Featured Post

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

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

PaperPort has a feature called the "Send To Bar". It provides a convenient, drag-and-drop interface for using other installed software, such as Microsoft Office. However, this article shows that the latest Office 2016 apps (installed with an Office …
Using Word 2013, I was experiencing some incredible lag when typing.  Here's what worked for me....
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

895 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