?
Solved

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

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

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

Question has a verified solution.

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

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…
Microsoft Access has a limit of 255 columns in a single table; SQL Server allows tables with over 255 columns, but reading that data is not necessarily simple.  The final solution for this task involved creating a custom text parser and then reading…
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.
Suggested Courses
Course of the Month13 days, 21 hours left to enroll

807 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