Inserting Records to Excel

Bhuvan

Member
Joined
Jun 25, 2008
Messages
7
Programming Experience
Beginner
Hi All,

I'm trying to insert data to excel sheet using oledbDriver. The excel sheet contains 40 columns and I'm trying to insert 820 records. Out of the 820 records, I have problem with 2 records. Those records contains 290 chars in a column. I'm getting the following error:
"The field is too small to accept the amount of data you attempted to add. Try inserting or pasting less data."

I'm using oledb parameters to insert records and the datataype for the specified column is (oledbType.Varchar,1000).But still I'm getting the same error. Kindly help me.
 
Excel 7.0 and lower has cell char limit of 255, highest OLE DB compatible version for this is 5.0. Using OLE DB version Excel 8.0 there is a limit of 32767 chars.
 
Inserting Records to Excel using VB.NET

Thanks for your reply. I'm using the following connection string to establish connection with Excel.

"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Sample.xls;Extended Properties=""Excel 8.0;HDR=YES;"""

But when I tried with the following connection string:

"Provider=Microsoft.Jet.OLEDB.5.0;Data Source=C:\Sample.xls;Extended Properties=""Excel 8.0;HDR=YES;"""

I'm getting the following Error:

The 'Microsoft.Jet.OLEDB.5.0' provider is not registered on the local machine.


Am I missing anything in the above connection string? Kindly help me.

Thanks,
Bhuvan R
 
Jet engine version should be 4.0, my post was about Excel versions and OLE DB Excel versions. The first connection string is the one.
 

Latest posts

Back
Top