Start by telling me the actual error message and which line it occurs on.
Also need to know what DProvider is equal to when it gets to the open statement.

If this does not get you past your problem then you should step through the code in that routine and see which lines are executing