Solved

ActiveX component can't create object

Posted on 2000-05-06
22
310 Views
Last Modified: 2013-12-25
I have written a program on Windows 95 (the "development machine"), which creates a database using ADOX and populates and manipulates it using ADO.

I have packaged the program using the Microsoft Visual Studio Installer. The program installs and runs OK on the development machine.

However, when I have installed and tried the program on a W98 computer (the "target machine"), I've got an error message "ActiveX component can't create object". It happened when the program called a subroutine whose first statement was:

      Dim rst As New ADODB.Recordset

I understand that the error means that the program could not create the recordset object.

Note that the error happened AFTER the program had successfully created a database on the target machine.

Any ideas?
0
Comment
Question by:karnovsk
  • 7
  • 6
  • 3
  • +3
22 Comments
 
LVL 142

Expert Comment

by:Guy Hengel [angelIII / a3]
Comment Utility
Normally, this means that mdac (ADODB) is not of the appropriate version.
You probably developed your appliation in a higher version than exists on the target machine.
Check the version of mdac_type.exe (or similar) on target and development machine. You should add ADO in your setup.
hope this helps
0
 
LVL 69

Expert Comment

by:Éric Moreau
Comment Utility
Have you installed DCOM98.EXE on this computer? Try it and then resinstall your application.
0
 

Author Comment

by:karnovsk
Comment Utility
To angelIII: I think your answer is in the correct direction. How do I add ADO to the setup with Visual Studio Installer?
0
 
LVL 69

Expert Comment

by:Éric Moreau
Comment Utility
It should be automatically detected!

Do you have file named MDAC_TYP.EXE in the list of files to be distributed?
0
 

Author Comment

by:karnovsk
Comment Utility
Hi emoreau,

When I was using the old Package & Deployment Wizard, I could see MDAC_TYP.EXE in the list of files, and indeed it used to install ADO before installing the program proper.

Now, with the Microsoft Visual Studio Installer, I see a module named MDAC.MSM in the list of files, but I don't know what does it exactly mean, and it DOES NOT install ADO.
0
 
LVL 69

Accepted Solution

by:
Éric Moreau earned 100 total points
Comment Utility
0
 

Author Comment

by:karnovsk
Comment Utility
I have found the following note in the MSDN article "Installer Package Files and Merge Modules":

Note   Unlike all other merge modules Visual Studio Installer provides, the mdac.msm file does not install Microsoft® Data Access Components when the installer package it belongs to is run. Instead, mdac.msm simply checks for the presence of Microsoft Data Access Components on the target machine.

So the question is how to force the Installer install MDAC.
0
 
LVL 69

Expert Comment

by:Éric Moreau
Comment Utility
Have you read the link I just gave you. It talks about a wrappersetup.
0
 
LVL 142

Expert Comment

by:Guy Hengel [angelIII / a3]
Comment Utility
I don't know Visual Studio Installer, but i think you should be able to add the mdac_typ.exe to the list of distributable files.
0
 
LVL 1

Expert Comment

by:billyh
Comment Utility
karnovsk, I know my suggention is going to be very strange, but I am a System Developer and I have had that problem a lot of times.

What I normally do is:
*Make sure that I am using ADO or DAO, never both

*Recompile my project, nad make a new exceutable project file.

*Repackage, this is where the strangeness comes in.

*I quickly click on the next buttons, to confuse the Packager.

*In doing this it usually brings up dependency files or other files needed by my application.

*I then go over the identified files, and complete the packaging.

*In the target machine, when I install the application I always pick "No to ALL" when there is a DLL difference.

The DLLs in my package over-write those of the target machine, these is dangerous in situations where the DLL you are over-writing is newer than your own. But all in all this always solves the problem.

Make sure that you are not using both DAO and ADO, most of the times it has nothing to do with DCOM 98, but a missing DLL/OCX or TLB.
0
 
LVL 142

Expert Comment

by:Guy Hengel [angelIII / a3]
Comment Utility
>> ... to Confuse the Packager ...

I think it is me now that is confused ?!
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 1

Expert Comment

by:billyh
Comment Utility
I said a strange solution, but it works for me. What I have realised is that when you move the "Next" button fast, the Package Wizard brings up all this other dependency files that it normally does not show when you do it slowly.

What I mean is this:

* Clicking the "Next" button continuosly without waiting for messages from the Package Wizard, that what fast means.

One other thing you can do is to go to the Script Manament utility still in the Package Wizard, delete all the scripts and then re-package the project again.

Another thing that I have noticed is that somethimes there is absolutely nothing wrong with your packaging, the problem lies with the target machine.

What I do here is to re-install Windows in the target machine. It so happens that some of these files (dlls, ocxs) get corrupted(not by your application, but other applications installed in the target machine), and when you install your application it then uses corrupted files giving out the error message that you have. So if the target machine does not contain critical informat just format the hard-disk and reinstall Windows 98.

Remember what I told you, most of the time this problem has nothing to do with DCOM98, but dlls, ocxs, or tlbs. So be sure that the target machine's Windows 98 contains correct dlls, ocxs, and tlbs.
0
 
LVL 4

Expert Comment

by:Jeremy_D
Comment Utility
billyh: We're talking about the Windows Installer here, which is a lot more difficult to confuse (and a lot more confusing!) than the Package & Deployment wizard.

The MDAC.MSM file is a merge module. Most merge modules contain the package they need to install, but not the MDAC and DCOM modules (ask Bill why, not me). These merge modules will only check if a current version of the package is installed. The fact that the Installer didn't tell you "Hey, MDAC is not installed, you should do that yourself first!" is proof that this was just another great M$ idea that died a horrible premature death due to wrong design and implementation.

Now for the solution. This is simple, you need to instal MDAC (and DCOM on 95 machines, this is not needed on 98 boxes since DCOM is installed with the OS there) before you install your own package. You can do this manually (or better, let a system administrator do it manually :), or you can follow emoreau's link to get a utility from M$ that does it for you.

Personally I would go for the manual install, but that's just because M$ make it *very* hard to trust their setup utilities. In my own company, the newest MDAC package is always on the standard ghost that gets installed on all the user's computers. This way we never have problems with it, but that will only work if your company uses Ghost or a similar application, of course.
0
 

Author Comment

by:karnovsk
Comment Utility
Dear colleagues,

Thank you all very much for the really enlightening discussion, from which I have learned a lot. Following emoreau's advice, I have downloaded the Wrapper program and started using it. I have written a program to be downloaded from an Internet site, therefore I must put eveything in it. I can't tell the user to download and install MDAC first.

Wrapper works OK but it is incredibly ugly (as they say in the old Crocodile Dundee movie: it tastes like **** but you can live on it). After I added the Windows Installer (for 9x and NT) and MDAC, my dowload module swelled from 3.5 MB to 12 MB. Has anybody any idea how to reduce this monster?

Actually, MDAC installation did not solve the original "ActiveX component can't create object" problem, but I think that something is wrong with my target machine. Therefore I thank you all very much again and close this question.
0
 
LVL 69

Expert Comment

by:Éric Moreau
Comment Utility
Your "ActiveX component can't create object" should be corrected by installing DCOM98.EXE!

"swelled from 3.5 MB to 12 MB" because of MDAC_TYP.EXE and it can't be broken.
0
 
LVL 4

Expert Comment

by:Jeremy_D
Comment Utility
>> Has anybody any idea how to reduce this monster?

You could just put a link to MDAC_TYP.EXE on the Microsoft homepage in your documentation or on your download page. It's freely downloadable if I'm not mistaking. A lot of people will have the Data Access Components already installed, so these people won't need it. Same goes for DCOM.
0
 

Author Comment

by:karnovsk
Comment Utility
To emoreau: I have installed DCOM98.EXE, but I still get  "ActiveX component can't create object". When I reboot this computer I get a message telling that ODBC must be reinstalled. Could this be the cause of the above message?

To  Jeremy_D: My problem is that most my program's users  - how to say it politically correct - are rather computer-challenged. I am developing genealogical software, and many my users have a hard time just downloading and installing a single program. If I tell them, "If you don't have ADO download it", they will just drop dead. Not all of them but some may.
0
 
LVL 69

Expert Comment

by:Éric Moreau
Comment Utility
Are you using ODBC? What is your connection string?

DCOM98 must be install before MDAC_TYP. Did you followed this sequence?

Are you sure that your error is still on "Dim rst As New ADODB.Recordset" or can't it be another line?
0
 

Author Comment

by:karnovsk
Comment Utility
To emoreau: I have installed DCOM98.EXE, but I still get  "ActiveX component can't create object". When I reboot this computer I get a message telling that ODBC must be reinstalled. Could this be the cause of the above message?

To  Jeremy_D: My problem is that most my program's users  - how to say it politically correct - are rather computer-challenged. I am developing genealogical software, and many my users have a hard time just downloading and installing a single program. If I tell them, "If you don't have ADO download it", they will just drop dead. Not all of them but some may.
0
 
LVL 4

Expert Comment

by:Jeremy_D
Comment Utility
>> My problem is that most my program's users  - how to say it politically correct - are rather computer-challenged

<sigh> I know the problem.
0
 

Author Comment

by:karnovsk
Comment Utility
To emoreau: It took me some time, but I have reinstalled Windows 98 (second edition), DID NOT install DCOM98, installed MDAC 2.5 and my application - and the above problem disappeared.

Thank you again for your help.
0
 

Expert Comment

by:jalleman
Comment Utility
It has to do with IE4.0 or greater being integrated into the operating system. If the target machine does not have IE4.0 or greater installed you will get the error "ActiveX component can't create object". Micro$quash, go figure.
0

Featured Post

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.

Join & Write a Comment

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
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.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

772 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

15 Experts available now in Live!

Get 1:1 Help Now