Link to home
Start Free TrialLog in
Avatar of SteveL13
SteveL13Flag for United States of America

asked on

Importing an Excel file into a table with one field being a memo field

I believe this was discussed a few days ago but I am really stuck.  I have an Excel file which contains a cell that has more than 255 characters.  I need to be able to import the entire contents of that cell into a table field.  But no matter what I try it only imports the first 255 characters even through the field in the table it is being imported into is a memo field.

Can someone help?

--Steve
Avatar of Professor J
Professor J

use concatenate and the restriction will be lifted.
Text values in formulas are limited to 255 characters. To create text values longer than 255 characters in a formula, use the CONCATENATE function or the concatenation operator (&).
I think to go around this quirk is to import into a temp table first and then append your data to the actual target table.
Avatar of SteveL13

ASKER

I did try importing to a temp table first. But when I looked at the contents of the field in the temp table only 255 characters were there.
I don't understand the CONCATENATE suggestion
I am not sure why it did not work for you using a Temp Table.
Are you sure you marked the Field Type Memo importing that field?

Couple of notes why this happens:

Source: Avoid DataType Mismatch Errors when Importing Data from an EXCEL File or when Linking to an EXCEL File

The truncated text string that you see is because Jet (ACCESS) sees only "short text" (text strings no longer than 255 characters) values in the first 8 - 25 rows of data in the EXCEL sheet, even though you have longer text farther down the rows. What ACCESS and Jet are doing is assuming that the "text" data actually are Text data type, not Memo data type. One of these suggestions should fix the problem:


1) Insert a dummy row of data as the first row, where the dummy row contains a text string longer than 255 characters in the cell in that column -- that should let Jet (ACCESS) treat that column's values as memo and not text.

2) Create a blank table into which you will import the spreadsheet's data. For the field that will receive the "memo" data, make its data type "Memo". Jet (ACCESS) then will "honor" the field's datatype when it does the import.
That did not work.
Are you doing the import manually or are you using a Command function like DoCmd.TransferSpreadsheet() ?
Manually.
Although eventually I need to DoCmd.transferspreadsheet.
SOLUTION
Avatar of danishani
danishani
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Yes.
You could save the Excel as an CSV file. Then import/link this.

/gustav
Gustav,

I had tried your suggestion but it didn't work.  But to be sure I'll try again and get back.
I just tried it again... saving the Excel file as a CSV Comma delimited (.csv) file and manually imported it into a test table.  The cell (field) with the character count over 255 stopped at 255 characters.

Very frustrating.
Have you tried just linking the worksheet? And/or inserting a very long text in the first row?

/gustav
I did try inserting a very long text in the first row but that didn't help.  And I can't use the method of linking to the worksheet because the intent is for outside people to send the Excel file to the office.  Then using DoCmd.transferspreadsheet append a table.
Then you may automation - open the Excel file and read the content of the range in question.

/gustav
As a test if anyone is willing to try it, I've attached an Excel file with the data "dummied" because I can't show the real data.  Plus a pretty much empty Access 2010 d/b.

I have tried over and over again to manually import the Excel file data into a new table and have all of the contents in cell B57 import properly and not cut off at 255 characters.  The Excel cell contains 1,077 characters and I sure wish I could make them all come over into the Access table.

--Steve
NotesToImport.xlsx
TestImport.accdb
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Long text isn't a choice for me when I'm setting up the manual import.  I only have the following:

User generated image
Plus I can't d/l your example file back to me.  When I click on it I get:

Standard ACE DBµnb` ÂUé©gr@?œ~Ÿÿ…š1Åyºí0¼ß̝cÙäßFûŠ¼N?Xì7äçœúý(檊`í7{6LÑß±ÎWCv ±3Ây[+|*£à|™˜ý-ãÏAI„f_•øЉ$…gÆ'DÒîÏeíÿÇF¡x íé-bÔT4.0Wd»v°:ÀðÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÞ Y)îîîîS ++ Y  ì Y îY  Y Y  Y  îþY  Y  î Y î Y î Y î Y þ Y 2ŸþY  Y  î Y  kþY ConnectDatabaseDateCreateDateUpdate FlagsForeignNameIdLvLvExtraLvModule LvPropName OwnerParentIdRmtInfoLongRmtInfoShortTypeƒÿÿîÿÿÿÿîÿÿÿÿîÿÿÿÿîÿÿîÿÿÿÿîÿÿÿÿîÿÿÿÿîÿÿÿÿîÿÿ»´YÿÿÿÿYÿÿÿÿIdParentIdName        ÿÿ©OY|Ïi!&S  +Y Y Y  Y 2pþACMFInheritableObjectIdSIDƒÿÿXÿÿÿÿÿÿNÿÿÀÿÿÿÿýÿÿ•ÿÿ¸ 5&€ˆYÿÿÿÿObjectIdÿÿë YS  Y  Y Y Y  Y þ Y þY  Y þAttributeExpressionFlagLvExtra Name1 Name2ObjectId Orderƒÿÿÿÿÿÿÿÿÿÿÿÿÿÿ Yÿÿÿÿ"ObjectIdAttribute  ÿÿË -YSSS  Y Y Y  Y j þ Y þ Y þ Y ¦þ Y þccolumn
Pick Memo.

Right-click file, Save As, change file extension from html to accdb.

/gustav