?
Solved

ActiveX component can't create object

Posted on 2000-05-06
22
Medium Priority
?
317 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 7
  • 6
  • 3
  • +3
22 Comments
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 2785384
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 70

Expert Comment

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

Author Comment

by:karnovsk
ID: 2785859
To angelIII: I think your answer is in the correct direction. How do I add ADO to the setup with Visual Studio Installer?
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 70

Expert Comment

by:Éric Moreau
ID: 2785876
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
ID: 2785903
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 70

Accepted Solution

by:
Éric Moreau earned 400 total points
ID: 2786293
0
 

Author Comment

by:karnovsk
ID: 2786314
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 70

Expert Comment

by:Éric Moreau
ID: 2786353
Have you read the link I just gave you. It talks about a wrappersetup.
0
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 2787614
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
ID: 2788738
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 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 2788788
>> ... to Confuse the Packager ...

I think it is me now that is confused ?!
0
 
LVL 1

Expert Comment

by:billyh
ID: 2791535
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
ID: 2796503
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
ID: 2797134
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 70

Expert Comment

by:Éric Moreau
ID: 2797353
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
ID: 2799230
>> 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
ID: 2801184
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 70

Expert Comment

by:Éric Moreau
ID: 2801604
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
ID: 2801864
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
ID: 2803695
>> 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
ID: 2827119
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
ID: 2891664
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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.
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…
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…
Suggested Courses
Course of the Month12 days, 20 hours left to enroll

777 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