Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Excel Data Truncated to 255 Characters

I'm trying to import the data from an Excel spreadsheet into a ADO.NET
DataTable using the Jet engine and I'm running into a problem where it
is truncating the text data to 255 characters. I know that it tries to
read x number of lines from the file (I think 8 by default) and make a
determination based on that about how big to make the DataTable
column. And I know that if I put one of the bigger values up at the
front of the spreadsheet that it will work properly but I don't want
to have to rely on doing that.

Apparently there is a registry setting (HKEY_LOCAL_MACHINE\SOFTWARE
\Microsoft\Jet\4.0\Engines\Excel\TypeGuesRows) you can set to make Jet
read in more lines before determining the max data length. Supposedly
setting it to 0 makes it read in all the rows. I've tried tweaking it
with no results. I really don't want to have to rely on modifying the
registry anyway.

I've also tried using the MAXROWSTOSCAN=0 in the Jet connection string
to no avail.

The only thing that appears to work is to move the data around. Isn't
there a better way to do this? Isn't there a way to get Jet to read in
all the rows before making the size determination?

I believe the files are in Excel 2003 format. Here is the connection
string I am using.

Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:/file.xls;Extended
Properties="Excel 8.0;IMEX=1;HDR=YES"

I also tried the Microsoft.ACE.OLEDB.12.0 provider and got the same
results.
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Text via ODBC truncated at 255 characters Walter Excel Programming 0 August 10th 07 08:50 PM
MS query returns truncated data to Excel memeli Excel Discussion (Misc queries) 0 May 20th 07 09:51 AM
Excel -- Excel data copy truncated at 255 characters KunzLeigh Excel Worksheet Functions 1 February 7th 07 10:08 PM
field data truncated in DBF file from Excel DanS Excel Discussion (Misc queries) 2 January 9th 07 09:46 PM
TextFrame.Characters.Text returns truncated string Dennis Excel Programming 2 October 1st 06 11:23 PM


All times are GMT +1. The time now is 03:56 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"