Solved

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

Posted on 2011-03-23
6
1,311 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
ID: 35206078
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
ID: 35206357
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
ID: 35216290
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
ID: 35216373
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
ID: 35354049
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

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
DSum for Access 6 47
Open CSV, modify and save as xls from Access 12 19
Newbie needs help printing from a form. 10 20
Format Meeting Request through VBA 5 21
The purpose of this article is to demonstrate how we can use conditional statements using Python.
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
The view will learn how to download and install SIMTOOLS and FORMLIST into Excel, how to use SIMTOOLS to generate a Monte Carlo simulation of 30 sales calls, and how to calculate the conditional probability based on the results of the Monte Carlo …
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.

896 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

14 Experts available now in Live!

Get 1:1 Help Now