OLEDB - C++ - ATL's OLEDB Provider sample crashes Excel (uncaught exception from msado15.dll)
See the question and my original answer on StackOverflowADO, the COM automation wrapper over OLEDB, queries for the OLEDB's ICommandText interface. Instead of complaining the interface is not implemented, it just continues with a NULL command text and crashes.
I supposed all this used to work, but doesn't anymore as for some reason (OLEDB coupled with ADO makes a quite complex technology), the ATL template that supports the command implements the interface but does not answer when queried for.
So to fix the issue, just add an ATL entry to the serviced interfaces for the command object:
BEGIN_COM_MAP(CFindFilesCommand)
...
COM_INTERFACE_ENTRY(ICommandText)
...
END_COM_MAP()