If the Excel workbook is protected by a password, you cannot open it for data access, even by supplying the correct password with your connection string.
Use IMEX=0 instead to be sure to force the registry TypeGuessRows=0 (scan all rows) to work. Please also note that adding the IMEX=1 option might cause the IMEX feature to set in after just 8 rows. That's the key to not letting Excel use only the first 8 rows to guess the columns data type. 'SELECT * FROM ', start picking the data as of row 5 and up to column D.Ĭheck out the located registry REG_DWORD 'TypeGuessRows'. excel worksheet name followed by a '$' and wrapped in '' brackets.
Note that this option might affect excel sheet write access negative. 'IMEX=1 ' tells the driver to always read 'intermixed' (numbers, dates, strings etc) data columns as text. 'HDR=Yes ' indicates that the first row contains columnnames, not data.