Reputation: 467
I have an SSIS 2008 package that reads data from an Access database (OLEDB data source) and uses it to update SQL Server tables.
When the updates are complete, I want the package to delete the Access database. I've tried a File System task and a Script task but neither work because the package is holding the database connection open.
I get the error message:
The process cannot access the file 'C:.....\abc.mdb' because it is being used by another process.
How can I get the package to release the database connection?
I've tried calling the Dispose() method on the ConnectionManager object, but to no avail. I've noticed that the ConnectionManager class has a ReleaseConnection method, but I think this will only release a new connection created with the related AcquireConnection method. I need SSIS to release it's own internal connection so the MDB file can be deleted.
Any suggestions?
Thanks in advance.
Upvotes: 3
Views: 597
Reputation: 96600
You could try setting up a job to run the ssis package that has two steps, one to run the package and one to delete the file. If the pacakge is done running, it should release the connection.
Upvotes: 2