×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

VB6 & MTS - Context Object Errors

VB6 & MTS - Context Object Errors

VB6 & MTS - Context Object Errors

(OP)
Whenever I use any methods connected to the Context Object, VB issues me a "Object variable or with block variable not defined" error. I have set references to MTS inside of VeeBee, but to no avail - what might be the cause of this ?

Many thanks
NetNeko


RE: VB6 & MTS - Context Object Errors

Often the problem is using:
oMyObject = something
instead of:
Set oMyObject = something

Alex

RE: VB6 & MTS - Context Object Errors

Another problem is using the new keyword when setting an object variable.

To use MTS you have to instantiate objects using the CreateObject function

Eg. Instead of
Set obj = new object
set obj = CreateObject(object)


RE: VB6 & MTS - Context Object Errors

You really should be using the CreateInstance keyword when creating MTS objects, for objects NOT controlled by MTS such as ADO recordsets etc you can use "CreateObject" or even better the "New" keyword.Using "CreateObject" when creating MTS objects can cause problems - especially scalability ones.Oddly enough in the new implementation of COM+ (COM+ promises to unite COM with MTS!)to run in Windows 2000 - "Createobject" again becomes the preffered method - funny old world isn't it? :-o)

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close