Solved

Automation Error from VB6.0 app

Posted on 2004-09-30
16
5,505 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
ID: 12193360
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
ID: 12193759
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
ID: 12193792
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
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
LVL 3

Expert Comment

by:joefm1218
ID: 12193909
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
ID: 12194061
what objects libraries are you referencing in your development machine? what os it has?
0
 
LVL 3

Expert Comment

by:joefm1218
ID: 12194198
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
ID: 12194330
wow, great stuff, thanks.
0
 

Author Comment

by:jedanner
ID: 12195144
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
ID: 12202253
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
ID: 12202760

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
ID: 12202956
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
ID: 12203190
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
ID: 12203233
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
ID: 12219757
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
ID: 12219847
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

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.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
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 process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…

828 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