How to remove Access data source in SSIS package?

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 tried the file system task and the Script task, but it does not work because the package supports opening a database.

I get an error message:

The process cannot access the file 'C: ..... \ abc.mdb' because it is used by another process.

How can I get a package to release a database connection?

I tried calling the Dispose () method on the ConnectionManager, but to no avail. I noticed that the ConnectionManager class has a ReleaseConnection method , but I think this will release a new connection created using the corresponding AcquireConnection method . I need SSIS to release its own internal connection, so the MDB file can be deleted.

Any suggestions?

Thanks in advance.

+3
source share
1 answer

You can try to configure the task to run the ssis package, which has two steps: one to start the package and one to delete the file. If pacakge is executed, it must release the connection.

+2
source

All Articles