SteveL13
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
Can someone help?
--Steve
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.
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.
ASKER
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.
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.
ASKER
That did not work.
Are you doing the import manually or are you using a Command function like DoCmd.TransferSpreadsheet( ) ?
ASKER
Manually.
ASKER
Although eventually I need to DoCmd.transferspreadsheet.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Yes.
You could save the Excel as an CSV file. Then import/link this.
/gustav
/gustav
ASKER
Gustav,
I had tried your suggestion but it didn't work. But to be sure I'll try again and get back.
I had tried your suggestion but it didn't work. But to be sure I'll try again and get back.
ASKER
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.
Very frustrating.
Have you tried just linking the worksheet? And/or inserting a very long text in the first row?
/gustav
/gustav
ASKER
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
/gustav
ASKER
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
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
ASKER
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.0W d» v°:Àðÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿ ÿÿÿÿÞ Y)îîîîS ++ Y ì Y îY Y Y Y îþY Y î Y î Y î Y î Y þ Y 2ŸþY Y î Y kþY ConnectDatabaseDate CreateDat eUpdate FlagsForeignNameIdLvLv ExtraLvMo dule LvPropName OwnerParentIdRmtInfoLong RmtInfoSh ortTypeƒ ÿÿîÿÿ ÿÿîÿÿÿÿîÿ ÿÿÿîÿÿ îîƒÿ ÿÿÿîÿÿÿÿ îÿÿÿÿîÿÿ ÿÿîÿÿ» ´Yÿÿ ÿÿYÿÿÿ ÿIdPar entIdName ÿÿ©OY|Ïi!&S +Y Y Y Y 2pþACMFInheritableOb jectIdSID ƒÿÿXÿÿÿ ÿÿÿNÿÿÀÿÿ ÿÿýÿÿ•ÿÿ¸ 5&€ˆYÿÿÿÿObjectIdÿÿ ë YS Y Y Y Y Y þ Y þY Y þAttributeExpression FlagLvExt ra Name1 Name2ObjectId Orderƒÿÿÿÿÿÿÿÿÿÿÿÿÿÿ Yÿÿÿÿ"ObjectIdAttribu te ÿÿË -YSSS Y Y Y Y j þ Y þ Y þ Y ¦þ Y þccolumn
Standard ACE DBµnb` ÂUé©gr@?œ~Ÿÿ…š1Åyºí0¼ßÌc
Pick Memo.
Right-click file, Save As, change file extension from html to accdb.
/gustav
Right-click file, Save As, change file extension from html to accdb.
/gustav