Text truncated to 255 characters when reading from Excel with Jet 4.0 OLEDB

One of those MS vagaries: text from my Excel sheet was truncated to 255 characters. Seehttp://support.microsoft.com/kb/281517 for the reason. Apparently, the driver guesses the maximum length of a column by looking at the first 8 rows of the Excel sheet. The MS article tells how to change this number, but does not provide a workaround. My (ugly) workaround is: modify the Excel sheet by inserting an extra row at the top that contains more than 255 characters. A subsequent read will identify the column as bigger than 255 characters and read ALL text in the sheet.



Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s