Solved

Automation Error from VB6.0 app

Posted on 2004-09-30
16
5,112 Views
Last Modified: 2008-01-09
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?

0
Comment
Question by:jedanner
  • 7
  • 7
16 Comments
 
LVL 3

Expert Comment

by:joefm1218
Comment Utility
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.
0
 

Author Comment

by:jedanner
Comment Utility
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 .
0
 

Author Comment

by:jedanner
Comment Utility
if i also explore a non source inspection approach could i just update OCX files  (or other files?) moved to C:\WINDOWS\system32  directory?
0
 
LVL 3

Expert Comment

by:joefm1218
Comment Utility
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).
0
 
LVL 16

Expert Comment

by:Richie_Simonetti
Comment Utility
what objects libraries are you referencing in your development machine? what os it has?
0
 
LVL 3

Expert Comment

by:joefm1218
Comment Utility
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.
0
 

Author Comment

by:jedanner
Comment Utility
wow, great stuff, thanks.
0
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 

Author Comment

by:jedanner
Comment Utility
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...
0
 
LVL 3

Expert Comment

by:joefm1218
Comment Utility
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).

0
 

Author Comment

by:jedanner
Comment Utility

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!!
0
 
LVL 3

Accepted Solution

by:
joefm1218 earned 500 total points
Comment Utility
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.
0
 

Author Comment

by:jedanner
Comment Utility
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?
0
 
LVL 3

Expert Comment

by:joefm1218
Comment Utility
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.
0
 

Author Comment

by:jedanner
Comment Utility
area in code stopped and hightlighted during run:

mdiMain(Code)


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?
thx.


0
 
LVL 3

Expert Comment

by:joefm1218
Comment Utility
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.
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now