Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Data Truncation importing Excel spreadsheet into Access 2010

Posted on 2011-09-02
8
Medium Priority
?
2,988 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 93

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 49

Expert Comment

by:Dale Fye
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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 74

Assisted Solution

by:Jeffrey Coachman
Jeffrey Coachman earned 664 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
 
LVL 93

Accepted Solution

by:
Patrick Matthews earned 668 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 49

Assisted Solution

by:Dale Fye
Dale Fye earned 668 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

Free Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

Question has a verified solution.

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

We live in a world of interfaces like the one in the title picture. VBA also allows to use interfaces which offers a lot of possibilities. This article describes how to use interfaces in VBA and how to work around their bugs.
With its various features, Office 365 can not only help you with your day-to-day business tasks, it can also do wonders for your marketing campaign.
This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

824 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