问题
In David Fenton's answer to the question "MS Access (Jet) transactions, workspaces" he states:
I would also say, never pass the workspace -- only pass the objects you've created with the workspace.
Is passing the workspace a bad idea? If so, why?
Additional info:
My intent here is to execute INSERT/UPDATE/DELETE statements from within multiple Subs/Functions but wrap them all in a single transaction.
The base functionality is wrapped up in a class module. I want to be able to isolate multiple instances of the class module, which means I can't just assume my transactions are executing against the default workspace.
来源:https://stackoverflow.com/questions/9264386/passing-dao-workspace-as-a-parameter-bad-idea