codeice / linqtoexcel

Automatically exported from code.google.com/p/linqtoexcel
0 stars 0 forks source link

A cell which has over 255 characters has been truncated #53

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1.read a excel, if one cell has over 255 characters, that cell cannot get all 
the content, only have 255 characters.

What is the expected output? What do you see instead?
All the characters. Only 255 characters.

What version of the product are you using? On what operating system?
version:1.5.3; os: windows 7

Please provide any additional information below.

Original issue reported on code.google.com by chenyong...@gmail.com on 2 Sep 2011 at 4:09

GoogleCodeExporter commented 8 years ago
This is an issue with the Jet OLEDB provider. It looks at the first 8 rows of 
the 
spreadsheet to determine the data type in each column. If the column does not 
contain 
a field value over 256 characters in the first 8 rows, then it assumes the data 
type 
is text, which has a character limit of 256. The following KB article has more 
information on this issue: http://support.microsoft.com/kb/281517

A solution would be to make sure one of the first 8 rows in the column has more 
than 
256 characters, wherein the Jet OLEDB provider will assume the data type is 
memo and 
will return more than 256 characters.

Original comment by paulyo...@gmail.com on 2 Sep 2011 at 4:51

GoogleCodeExporter commented 8 years ago
http://support.microsoft.com/kb/281517 is now a dead link. 
I found useful information at http://support2.microsoft.com/kb/189897/. This 
will tell you how to modify the configuration of the yet engine to sample more 
rows. It involves setting a new value for TypeGuessRows in the registry.
In contrast to what the article describes, I found this key at: 
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Office\12.0\Access 
Connectivity Engine\Engines\Excel]. I do not have Office installed, but the 
Microsoft Access Database Engine Redistributable. Anyway, you can always search 
the registry for 'TypeGuessRows'. I set it to 0, just to be sure to sample all 
rows and it solved the issue. 

Original comment by roel.sch...@gmail.com on 20 Nov 2014 at 12:00