My application uses ATL OLE DB Consumer Templates but I wish to upgrade the OLE DB Driver to "Microsoft OLE DB Driver for SQL Server" (Version 18.2 or 18.3) and I have downloaded the driver, installed it, changed the Provider in my connection string in the application to "Provider=MSOLEDBSQL", run the application only to see in the debugger in the atldbsch.h file as the code gets there when stepping row-by-row that it is linked towards oledb32.dll and sqloledb.dll instead of the new msoledbsql.dll which gets installed in the System32 directory.
I can't get it to use the new OLE DB Driver; what do I need to to to make it link to the new DLL? Is it the fact that the application uses ATL OLE DB Consumer Templates that dictates this?
I am trying to connect to SQL Server 2012 database where I'd like to use the DATETIME2 data type but in my C++ code I get a datatype 130 back which maps to a WSTR - varchar(27) instead of a DB_DATETIME (datatype 135). This should not happen if the code successfully is using the 18.2 or 18.3 version of "Microsoft OLE DB Driver for SQL".
Alright, I may have solved it myself, but I tried a lot of stuff trying to get it to work so I am not entirely sure what I did. However, my suspicions are that I moved the include of "msoledbsql.h" as far down as possible in the stdafx.h file so that it gets included as late as possible in case any other include-file there includes any other old oledb file.
Don't know if this helps anyone but it seems to have worked for me.