Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Class does not support Automation... on a Set cmd = New ADODB.command

Status
Not open for further replies.

briansmithdanisco

IS-IT--Management
Jun 13, 2007
19
US
Hi,

I have an Access 2003 database that has VBA written to to do a select statement. The code has been running for several years, but all the sudden I am getting the "Run-time error '430': Class does not support Automation or does not support expected interface"

The code that seems to be causing the error is where I define the recordset. I have the following:
Dim cmd As ADODB.Command
Dim rst As ADODB.Recordset
Set cmd = New ADODB.Command <-- This is the error line

The error is thrown on the Set cmd line.

The only thing I can find to fix it is to put the "New" on the first line where I Dim the recordset name:
Dim cmd As New ADODB.Command
Dim rst As ADODB.Recordset

It seems to fix the problems. My question is why all the sudden this is happening, and why would the error not happen on all the computers that run it? The database itself is on a common netowrk drive and people run it from their own computers.

In my Tools --> References I have the Microsoft DAO 3.6 Data Objects 2.1 Library checked. I alos have OLE Automation, Visual Basic For Applications, Microsoft Access 11.0 Object Library, and Microsoft ActiveX Data Objects 2.1 Library checked.

I have several other Access 2000 and 2003 applications running in the same setup without any problems. This has happened in 2 other databases, but I cant seem to find any connection between anything.

Any thoughts?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top