Open an Excel File with DataAdapter

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

We are opening an excel file using a dataadapter object.
The tables included in excel file are loaded into a dataset object.
This process works correctly except for this issue:

There is an "Comment" field included in the excel sheet with 255 characters,
but the dataset only read 64 characters.

Have any idea to solve this problem?
 
¤ We are opening an excel file using a dataadapter object.
¤ The tables included in excel file are loaded into a dataset object.
¤ This process works correctly except for this issue:
¤
¤ There is an "Comment" field included in the excel sheet with 255 characters,
¤ but the dataset only read 64 characters.
¤
¤ Have any idea to solve this problem?
¤

Don't think I've seen this issue before unless the number of characters exceeds 255. Couple of
things to try. Assuming you're using the Jet OLEDB provider and Excel ISAM I would add the IMEX
argument to your connection string:

"Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=D:\My Documents\Book2.xls;Extended Properties=""Excel 8.0; IMEX=1;"""

You may want to try changing the TypeGuessRows entry in the Registry as well:

http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q281517


Paul ~~~ (e-mail address removed)
Microsoft MVP (Visual Basic)
 
Paul,

We try with your tips but our problem remains.

when we ask for the "comment" field stored in dataset, it contains only 64
characters.

If you prefer, we can send you the source code.

Thanks for you answer

JASV
 
¤ Paul,
¤
¤ We try with your tips but our problem remains.
¤
¤ when we ask for the "comment" field stored in dataset, it contains only 64
¤ characters.
¤
¤ If you prefer, we can send you the source code.
¤
¤ Thanks for you answer
¤
¤ JASV

If you want to send me a sample Excel workbook (in a zip file) I can take a look at it.


Paul ~~~ (e-mail address removed)
Microsoft MVP (Visual Basic)
 
Back
Top