[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

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

Posted on 2011-03-23
6
Medium Priority
?
1,334 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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

In earlier versions of Windows (XP and before), you could drag a database to the taskbar, where it would appear as a taskbar icon to open that database.  This article shows how to recreate this functionality in Windows 7 through 10.
The Windows Phone Theme Colours is a tight, powerful, and well balanced palette. This tiny Access application makes it a snap to select and pick a value. And it doubles as an intro to implementing WithEvents, one of Access' hidden gems.
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

650 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