Article ID: 188919 - Last Review: August 30, 2004 - Revision: 1.2 How To Avoid "Error 91" when Debugging MTS Components with Visual Basic
This article was previously published under Q188919 On This PageSUMMARY
When developing Visual Basic components to run under control of Microsoft
Transaction Server (MTS), if your object uses ObjectContext, you may
encounter the following error when trying to debug them within the Visual
Basic environment:
Run-Time Error '91': Object variable or with block variable not set.
There are two ways to avoid this error when writing Visual Basic components. The first is to configure Visual Basic to use a special version of the object context. The second way is to use the Microsoft Developer Studio environment. MORE INFORMATION
To facilitate application debugging using Visual Basic, you can debug a
component that uses ObjectContext by enabling a special version of the
object context. This debug-only version is enabled by creating the
following registry key:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Transaction
Server\Debug\RunWithoutContext
Steps to Create the Registry Key
NOTE: When running in debug mode, none of the functionality of MTS is enabled. GetObjectContext returns the debug ObjectContext rather than returning Nothing. When running in this debug mode, the ObjectContext operates as follows:
REFERENCES
For more information on debugging compiled Visual Basic components using
the Microsoft Developer Studio environment, please see the following
articles in the Microsoft Knowledge Base:
166275
(http://support.microsoft.com/kb/166275/EN-US/
)
How To Debug a Native Code Visual Basic Component in VC++
244457
(http://support.microsoft.com/kb/244457/EN-US/
)
How To Debug an MTS Visual Basic Component Running Under ASP
Microsoft Transaction Server 2.0 Help; search on: "Debugging Visual Basic
MTS Components"
APPLIES TO
| Other Resources Other Support Sites
CommunityGet Help NowArticle Translations |






Windows Live
Facebook
Twitter
Linkedin
Digg it
Yahoo
Delicious
StumbleUpon
Yammer
Reddit
Technorati
FriendFeed
Email

Back to the top
