?
Solved

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

Posted on 2011-03-23
6
Medium Priority
?
1,330 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
[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
  • 2
  • 2
6 Comments
 
LVL 58
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 46

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 58

Accepted Solution

by:
Jim Dettman (Microsoft MVP/ EE MVE) earned 2000 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

Percona Live Europe 2017 | Sep 25 - 27, 2017

The Percona Live Open Source Database Conference Europe 2017 is the premier event for the diverse and active European open source database community, as well as businesses that develop and use open source database software.

Question has a verified solution.

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

Access custom database properties are useful for storing miscellaneous bits of information in a format that persists through database closing and reopening.  This article shows how to create and use them.
Microsoft Access is a place to store data within tables and represent this stored data using multiple database objects such as in form of macros, forms, reports, etc. After a MS Access database is created there is need to improve the performance and…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Suggested Courses

752 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