• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 7585
  • Last Modified:

Automation Error from VB6.0 app

I've was given a VB6.0 application that is installed on an XP machine with Office 2000 using MSDE 2000. I'm able to log in (accessing MSDE) through the vb application but as soon as I click on some features built into the app i get this error message:

Automation error The object invoked has disconnected from its clients
Hand Writing Detection could not be enabled

What object ? What client? Any ideas?
Is this two errors listed into one message?  
Registering problem?

  • 7
  • 7
1 Solution
Sounds like you might have to run in debug mode to determine what object is throwing the Automation error. The problem is most likely caused by some form of binary incompatibility (ie. wrong version of COM DLL's, EXE's).

If you have the source, you should open the project and check all the project references. Look for broken references first. If nothing looks fishy there, debug the project and start setting break points at points of failure. Some where along the way, you will nail down the object or method call that is firing the error.
jedannerAuthor Commented:
what would a broken reference look like? what would a 'reference' reference ? Is there a particular module or common file name that usually contains most reference listings? thanks joefm1218 .
jedannerAuthor Commented:
if i also explore a non source inspection approach could i just update OCX files  (or other files?) moved to C:\WINDOWS\system32  directory?
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

When you open a project in VB6.0, you can look under Project->References. Look at all the checked boxes there. All of the components should have a valid reference (which you'll see the reference named properly). If the reference is marked 'MISSING', then there will definitely be runtime issues with the application. This means that the binary component registered on your machine is not compatible with the component expected by the application.

If your machine has a newer version, then you might be able to simply re-reference the newer component by picking the newer named reference in the list and unselecting the 'MISSING' reference. If your machine doesn't have the component referenced at all, then you need to install the missing component (whether it be MDAC or whatever else).

Only once all the references look clean, should you begin to debug the project for failed object creations (or failed method calls).
Richie_SimonettiIT OperationsCommented:
what objects libraries are you referencing in your development machine? what os it has?
If you knew the OCX's, DLL's and EXE's that are required by the app (not just the name, but version), then you could register those components on your machine and you might be ok. There are a couple of hitches with this approach:

1) Does the DLL, OCX, EXE itself have further dependencies? If so, you will need to include those dependencies as well.

2) You will need to register the OCX, DLL, EXE within the register if it's a COM component (not just copy them is your system folder). Also, I don't recommend you use your system file to hold any custom DLL'e, OCX's, etc.

This process is very risky and will not probably result in success. That's why there is a packaging wizard to create a setup program with your applications. This wizard creates everything you need to distribute your application.

If the application is only dependent on 3rd party stuff, then you can simply install the correct versioned third party sutff on your machine, and you should then be ok. The trick here, is finding out the correct 3rd party components and their correct versions. That's why opening the project will help in this regard. It will help you determine the correct dependencies for the project.
jedannerAuthor Commented:
wow, great stuff, thanks.
jedannerAuthor Commented:
Project > References : items 'checked' for project.vbp are:

Visual Basic For Applications
Visual Basic runtime objects and procedures
Visual Basic objects and procedures
OLE Automation
Microsfot Data Environment Instance 1.0 (SP4)
Microsfot ActiveX Data Objects 2.5 Library
Microsoft Data Binding Colletions VB 6.0 (SP4)
Microsoft Data Environment 1.0
Microsfot Data Enviroment Extensibility Objects 1.0
Microsoft Data Formatting Object Library 6.0 (SP4)
Microsoft Data Report Designer 6.0 (SP)

I don't see any items checked and missing a name, hummm...
You should check the Project->Components option for the same issue (these represent OCX's or the visual components in the project).

If that looks good, then the next step would be to debug the project and find out where the Automatior error is occurring. You just need to zone in on the location of the error using break points (and/or debug messages, msgbox).

jedannerAuthor Commented:

On the very first project loading
I get a weird message  "Method '~' of object '~' failed".

Additionallly one error message follows another referring to *.ocx files that could not
load. I downloaded VB6.0 Service Pack 6. On reloading,  the .ocx loading error message problem went away.

I then run a full compile and get hung up on:

rsInvoice As New ADODB.Recordset

I checked again the Project > References

find: MISSING: Microsoft ActiveX Data Objects 2.0 Library

If I uncheck it, what should I replace it with and where do I get it
and how do you put it into Visual Studio so it can be selected?

joefm1218, big thanks!!
It looks like SP6 solved some ActiveX control binary incompatiblities (ie. Project->Components)

MISSING: Microsoft ActiveX Data Objects 2.0 Library

This is a very old version of ADO. You can use the more recent:

Microsoft ActiveX Data Objects 2.6 (or 2.7) Library.

Just check what versions you have registered on your machine and pick an appropriate one.

BEWARE: By using a newer driver, you are risking breaking something that might have changed from the old driver. If this occurs, you might want to try an older version to see if that works.
jedannerAuthor Commented:
how do you check what versions are on machine? Is Microsoft ActiveX Data Objects 2.6 Library the same thing as MDAC 2.6 including the library?
yes. MDAC 2.6 registers the 2.6 ADO library on your machine.

In Project->References, you will see the 2.6 library entry. You can simply uncheck the MISSING 2.0 library and select the 2.6 library.
jedannerAuthor Commented:
area in code stopped and hightlighted during run:


Private Sub mnuCheckEntry_Click()

    frmCheckProcess.Show vbModal, Me  //highlighted area with error

End Sub

How can I view more information about this highlighted area in vb?

frmCheckProcess.Show vbModal, Me  is where the Automation error occurs?

If so, do you have the source code for the frmCheckProcess form? Within the form_load(), or some intialization portion of this form is probably where the automation error occurs.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

  • 7
  • 7
Tackle projects and never again get stuck behind a technical roadblock.
Join Now