Search code examples
ms-accessvbarecordset

"ActiveX component can't create object" in Access 2000 VBA app


I've got a VBA application that throws an "ActiveX component can't create object" exception when trying to run.

enter image description here

The breakpoint is set on the line that throws the exception:

enter image description here

I'm assuming that it has something to do with Me.Recordset (Me being the Access form). The recordset is probably related to the Microsoft DAO Library, which is referenced. Here are the current references:

enter image description here

The application is running on a Windows 98 machine, and the Access .mdb allegedly ran fine before (noone remembers what other computer it was originally on or the configuration of it. The form itself just scrolls through records of data (which works fine), but when firing the above Calc_Confidence_Level() subroutine, it tosses an error on the recordset that I thought would be the same one that it was scrolling through.

Does anyone know what's going wrong here? Even a push in the right direct to be able to debug this better would be great, as I don't exactly work with VBA/Access very often.

Thanks!


Update 1

I looked in "C:\Program Files\Common Files\microsoft shared\DAO\" and don't see a .dll at all, only a .tlb file. There should be a .dll in there, right?

enter image description here


Solution

  • You should make clear if (1) you have an active recordset in your form, and then (2) if your recordset is an ADODB one, or a DAO one. Usually, when a form is open the standard way (with a 'recordsource' property referring to a local\linked table or view), the recordset is of the DAO type. In these conditions, you need the DAO library. If there is no 'recordsource' property for the form, there is no recordset, or it has to be set 'on the fly', for example in the 'on open' event. You then have to check what kind of recordset is declared in the proc. ('findfirst' is a DAO method, that cannot be used with ADODB recordsets)

    Another thing could be to make sure that the form is not corrupted: open a new\empty database, import all objects from your active database, and test it.