Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > VB How-To
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
VB How-To Ask your "How do I do this with VB?" questions in this forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB How-To section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old July 12th, 2003, 03:12 PM
Authorized User
 
Join Date: Jun 2003
Location: Shirleysburg, PA, USA.
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts
Default Detect MDAC

Hello
I am looking for some code to detect if the presents of MDAC exists
and display a msgBox stating weather or not it exists and if so which version is installed.

Can anyone help?
Reply With Quote
  #2 (permalink)  
Old July 14th, 2003, 03:12 AM
Authorized User
 
Join Date: Jun 2003
Location: , , Japan.
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default

The MDAC Component Checker should do that, but it's a stand-alone utility. I'd also be interested to see if it can be done with VB code, but somehow I suspect not.

Here's the URL for the Component Checker anyway:
http://www.microsoft.com/downloads/d...DisplayLang=en
Reply With Quote
  #3 (permalink)  
Old July 14th, 2003, 03:34 AM
Imar's Avatar
Wrox Author
Points: 72,073, Level: 100
Points: 72,073, Level: 100 Points: 72,073, Level: 100 Points: 72,073, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

Hi there,

You may be able to use the Version property of a Connection object:

Code:
Dim connTest As ADODB.Connection
Set connTest = New ADODB.Connection
MsgBox (connTest.Version)
Even when the application references version 2.1, this will return 2.7 (on my system).

It's not fool proof and you'll need ugly On Error Resume Next statements to catch systems that don't have ADO installed at all but it might just be enough for your purposes.

Alternatively, you could write code that checks versions of DLLs or does a registry lookup. I am not sure where exactly the information is stored, but you could search the registry for the GUIDs of ADO objects:

00000206-0000-0010-8000-00AA006D2EA4 (2.6)
EF53050B-882E-4776-B643-EDA472E8E3F2 (2.7)

If you're lucky, this may help you to find some more clues about the version information stored in the registry.

HtH

Imar


---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
Reply With Quote
  #4 (permalink)  
Old July 17th, 2003, 08:18 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: , , United Kingdom.
Posts: 1,212
Thanks: 0
Thanked 1 Time in 1 Post
Default

Try this registry key:
HKEY_LOCAL_MACHINE\Software\Microsoft\DataAccess\F ullInstallVer
Reply With Quote
  #5 (permalink)  
Old July 17th, 2003, 01:02 PM
Authorized User
 
Join Date: Jun 2003
Location: Shirleysburg, PA, USA.
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks to everyone who replied.
Let me try to explain a little more what I need.
my partner and I are working on a program that requires MDAC.
When the program setup is run, I need to test for MDAC and if it exists
then setup can continue but if it does not exist I need to stop setup and
display a msgBox stating mdac must be installed prior to setup.

I tried what you said Imar but this would have to be put into an install I
believe
and it requires MDAC also so I don,t think I can make that work.

And Phil, I'm not sure if I can make the component checker work in our
setup.

Is there any code we can use to check for the registery value pgtips posted?

Thanks again
Rick
Reply With Quote
  #6 (permalink)  
Old July 17th, 2003, 01:15 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: McPherson, Kansas, USA.
Posts: 128
Thanks: 0
Thanked 0 Times in 0 Posts
Default

This is not an answer but I have a some thoughts and a similar question.

1. What are you using for the install?

Previously, I had been using the package and deployment wizard but within the last year I have started using Visual Studio Installer to create the Windows Installer packages. One of the things I liked in the package and deployment wizard is I could include the MDAC executable and it would run the setup. I have not been able to do this with the Visual Studio Installer. The closest I have been able to come is use the "Register Now" button to call the MDAC exe. So, far this has not been a big concern of mine since the development I am doing these days is in house. Soon that will be changing a bit. i don't want to have a hokey setup like that.

Now to my point, the MDAC executable will only install the required files if they do not exist. I read this recently on one of Microsoft's sites. If the executable can run as a standard part of the install package no harm is done. As I mentioned this was achievable with the package and Deployment wizard. But I have not been able to obtain that functionality using the Visual Studio Installer. I have tried to edit the install using ORCA as presented in one of WROX publications, Professional VB6 2003, but am unable to find what I need.

Summary: Why not include the MDAC exe as part of the typical setup and let it run?


Larry Asher
Reply With Quote
  #7 (permalink)  
Old July 17th, 2003, 02:34 PM
Authorized User
 
Join Date: Jun 2003
Location: Shirleysburg, PA, USA.
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks Larry
We use inno setup. The problem with bundling the 2 together is the install is 5mg and mdac is a little over that. this program is downloadable from a web site and mdac may already be installed on most computers so we don't want to tote this thing around if there is no need. But if it is needed then it also can be downloaded, installed and then the setup for the program can be run.
Rick
Reply With Quote
  #8 (permalink)  
Old July 17th, 2003, 02:53 PM
Authorized User
 
Join Date: Jun 2003
Location: , Quebec, Canada.
Posts: 78
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I agree with Larry, you should always run the MDAC installation. One of my colleague experience problem with the check code to see if the MDAC 2.6 is installed. Some times, it would says that the 2.6 version was installed when in reality it was partially installed. So when the user was running the software it crashed because of that. So if you always run the MDAC installation, you should be able to avoid this problem.

Check this Article of MSDN for information with the MDAC installation and redistribution: http://msdn.microsoft.com/library/de...dacinstall.asp and http://msdn.microsoft.com/library/de...redistmdac.asp

Stéphane Lajoie
Reply With Quote
  #9 (permalink)  
Old July 17th, 2003, 03:09 PM
Authorized User
 
Join Date: Jun 2003
Location: Shirleysburg, PA, USA.
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks everyone.
Looks like decision time.
I will run this past my partner and see if we can hash
this out.
Rick
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
installing MDAC ubsacc2004 ASP.NET 1.0 and 1.1 Basics 3 April 26th, 2006 10:47 AM
A problem with running MDAC file amouzeshgah BOOK: Beginning ASP.NET 1.0 4 March 10th, 2006 12:52 PM
ADOX/MDAC Problem r4ross Access VBA 2 December 2nd, 2005 10:39 AM
Beginning Access 2000 - MDAC 2.1 donr3369 BOOK: Beginning Access VBA 1 May 12th, 2005 02:16 PM
MDAC johanyu ASP.NET 1.0 and 1.1 Basics 1 October 6th, 2004 03:22 PM



All times are GMT -4. The time now is 12:53 AM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.