ADO reference issue in Excel 2010 with physical and virtual machines

Posted on 2011-09-08
Last Modified: 2012-06-27
I have a spreadsheet with VBA that has a reference to the ADO 2.0 library.  The VBA opens a connection to a SQL Server database, executes a command, and stores it in a recordset.

If the code is executed and saved on a physical Windows 7/Excel 2010 machine, and then opened on a virtual Windows 7/Excel 2010 machine, the code will not run.  

The error is "Error occured while retrieving data from the database (Error #: 430 - Error Description: Class does not support Automation or does not support expected interface)"

However, if the ADO reference is changed from 2.0 to 2.x, saved, and then changed back to 2.0, it will work.  

Any possible reason a physical machine would cause this issue and a virtual would not?
Question by:rescapacctgit
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
  • 4
  • 2
LVL 16

Expert Comment

ID: 36505662
The best I can guess is the path (in references) is different between the virtual machine and the physical machine.

That can be checked by opening in one environment vs the other and see if a reference is missing.

Author Comment

ID: 36506301
Normally we use virtual machines only for these files.  

Oddly enough after running on a physical machine, the reference doesn't appear broken.  The paths are the same:

C:\Program Files\Common Files\System\ado\msado.tlb.
LVL 16

Expert Comment

ID: 36506344
You mentioned 2 different references (2.0 vs 2.x).  Same file path for both file references within the two different environments?
Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

LVL 16

Expert Comment

ID: 36506348
2.0 and 2. whatever will have different file names.
LVL 16

Accepted Solution

carsRST earned 500 total points
ID: 36506393

Author Comment

ID: 36506487
Thank you, carsRST.  

Featured Post

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

Question has a verified solution.

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

Freeze panes is an option within all variants of Excel to enable parts of a sheet to remain stationary when the cursor is in another part of the sheet. This is a very useful feature which is overlooked or under used.
You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

724 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