Multiple Threads in Your Add-in

You can start a background thread to manipulate the contents of the repository. If your background thread performs no updates against the repository, you can use the same repository instance as the Repository Add-in for Visual Basic. However, if your background thread will modify the contents of the repository, you should create and use a separate repository instance for this thread.

When Microsoft Jet is used to manage your repository database, a special restriction applies with regard to using multiple threads. An open repository instance to a repository database that is managed by Microsoft Jet can only be used by the thread that created the instance.

Since Visual Basic runs all in-process add-in modules in the same thread, this restriction is not a problem for a single-threaded add-in module. However, if your add-in accesses the repository through multiple threads, and your repository database is managed by Microsoft Jet, you should create and use a separate repository instance for each thread that accesses the repository.