Search code examples
excelconnection-stringoledb

What is the default value of IMEX in OLEDB?


string strConn = "Provider=Microsoft.Ace.OLEDB.12.0;Data Source=" + filename + ";Extended Properties=\"Excel 12.0 Xml;HDR=Yes;IMEX=1\";";

I search on google, and got no results. I think the default value is 2, but I am not sure.

Anyone can help me? Thanks.


Solution

  • Per the article below, IMEX values of 0 and 2 do the same thing; they use ImportMixedTypes=MajorityType. That is the default if you don't specify IMEX=1 in your extended properties.

    So the default IMEX behavior is MajorityType, and this can be overridden by using IMEX=1 in your connection string along with the registry setting ImportMixedTypes=Text.

    http://www.instantpages.ltd.uk/ADODB_WP.htm