Solved

Access 2010 - Class does not support automation or does not support expected interface

Posted on 2011-03-23
6
1,309 Views
Last Modified: 2012-06-27
Hi,
I am working on upgrading Access from 2003 to 2010. The steps I followed are,
 Open the Access 2010
 Import the old 2003 database
 Run the new database application.
I am getting error 'Class does not support automation or does not support expected interface' and it is coming for the below code,

Application.CurrentProject.AccessConnection.Execute ("DELETE FROM tblImportStatus")

If I change the code to - DoCmd.RunSQL ("DELETE FROM tblImportStatus")
It is working fine.
I have few other instances where I am getting same error,
Application.CurrentProject.AccessConnection.Execute ("INSERT INTO tblImportStatus(FileName,FilePath,ImportStatus) " & _
                    "Values('" & objFile.Name & "','" & objFile.Path & "','SUCCESS')")

Set cmd.ActiveConnection = Application.CurrentProject.AccessConnection

To fix this do I need to add any references ?
As of now I added few references and the attachment have those details,
 Doc1.doc
0
Comment
Question by:AccessRaj
  • 2
  • 2
6 Comments
 
LVL 57

Expert Comment

by:Jim Dettman (Microsoft MVP/ EE MVE)
Comment Utility
Sounds like you have a problem with ADO.   I cannot see from your attached doc the full references, so I do not know if you have some duplicated ones or not.

The other issue is that support for ADPs was dropped, and things may be working a bit differently now.  You should be aware of the differences between  .Connection and .AccessConnection.  Note in this article:

Difference Between Connection and AccessConnection Properties
http://support.microsoft.com/kb/281784

  That there are times when you should not be using .AccessConnection as the OLEDB10 class lib does not support all operations.  I believe this is what you are bumping into.  Try changing your code to .Connection

JimD.
0
 
LVL 45

Expert Comment

by:aikimark
Comment Utility
Better yet, change your SQL execution to use dbEngine(0)(0).Execute

Example:
dbEngine(0)(0).Execute "DELETE FROM tblImportStatus"

Open in new window

0
 

Author Comment

by:AccessRaj
Comment Utility
Hi,
I tried to use Connection instead of AccessConnection but got error "Class not registered"

Thanks,
Raj
0
 
LVL 57

Accepted Solution

by:
Jim Dettman (Microsoft MVP/ EE MVE) earned 500 total points
Comment Utility
Raj,

  I am not sure what the problem is then.  :(

  You might want to uncheck everything but the main ADO reference and then try.  I could not tell from your screen shot exactly what was being loaded.

  You may not need all the references currently checked.

  Not positive that will get your problem solved though.

JimD.

0
 

Author Closing Comment

by:AccessRaj
Comment Utility
Thank you for you help, it seems the issue is with drivers. I moved to another system and these are working fine.
0

Featured Post

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Join & Write a Comment

Suggested Solutions

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.
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

771 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

12 Experts available now in Live!

Get 1:1 Help Now