Skip to main content
ATL Server Library Reference 
RemoveDataSource 

Call this function to close a cached connection and remove it from the data source cache.


static HRESULT ATL_NOINLINE RemoveDataSource(
   IServiceProvider * pProvider,
   LPCTSTR szID 
);

Parameters

pProvider

The service provider expected to expose IDataSourceCache.

szID

The ID of the connection in the cache.

Returns S_OK on success, or an error HRESULT on failure.

This wrapper function queries pProvider for the IDataSourceCache service and, if successful, calls IDataSourceCache::Remove using the remaining argument.

Note that closing the connection in the cache does not affect the connections retrieved from the cache because they are copies of the original.

Header: atlcache.h