.net - Reading Excel sheet using ACE.OLEDB.12.0 with IMEX=1 not working -


i'm using below connection string ace.oledb.12.0 read data xlsx spreadsheet, set imex=1, not work while when remove ibex=1 completely, works fine.

"provider=microsoft.ace.oledb.12.0;data source=c:\working folder\icde\ramsden 4.xlsx;extended properties=""excel 12.0 xml;hdr=no;imex=1;""" 

can explain why, cos had impression imex=1 reads data text, more secure!

thanks

jp

imex=1 does not return data text. it's common misconception.

what oledb scan first n rows (default=8) , determines data type. if leave out imex=1 return null values not match data type. if include imex=1 , scan encounters mixed data types return text. if sheet has text header can process specifying hdr=no , discarding header. oledb always scan first n rows determine data type , return results accordingly.

the rows scan determined value of typeguessrows.

the older microsoft.jet.oledb.4.0 driver allow specify typeguessrows in connection string microsoft.ace.oledb.12.0 not. typeguessrows held in registry under...

excel 2007: hkey_local_machine\software\microsoft\office\12.0\access connectivity engine\engines\excel\typeguessrows excel 2010: hkey_local_machine\software\microsoft\office\14.0\access connectivity engine\engines\excel\typeguessrows excel 2013: hkey_local_machine\software\microsoft\office\15.0\access connectivity engine\engines\excel\typeguessrows 

32 bit applications running on 64 bit machine find them under wow6432node. e.g...

hkey_local_machine\software\wow6432node\microsoft\office\12.0\access connectivity engine\engines\excel\typeguessrows 

this retrograde step in opinion there must valid reason. if find 1 let know.


Comments

Popular posts from this blog

angular - Ionic slides - dynamically add slides before and after -

minify - Minimizing css files -

Add a dynamic header in angular 2 http provider -