Solved

activex error

Posted on 2003-12-08
1
187 Views
Last Modified: 2010-05-01
i have the following code:

Private WithEvents rsSample as ADODB.Recordset
Set rsSample = New ADODB.Recordset

at the second line i get an error that Activex cannot create the object. why am i getting this error and what do i do?
0
Comment
Question by:RTKVSNL
1 Comment
 
LVL 3

Accepted Solution

by:
TimW1 earned 50 total points
Comment Utility
I am assuming here that Private withevents etc is declared class scope and set rsSample etc is inside a function somewhere?
I also assume its not in a module? (if any of this is not corrrect or you are not sure please let me know)

First check the version of MDAC.  Open regedit and check HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\DataAccess\Version
If you don't have that key or the latest version you may want to download it from MS.  2.8 is currently the latest I think.(http://www.microsoft.com/downloads/details.aspx?FamilyID=6c050fe3-c795-4b7d-b037-185d0506396c&DisplayLang=en)
Check the reference in VB.  Menu "Project - References".
You need to have "Microsoft ActiveX Data Objects 2.6 Library" checked.  (Or whatever version you have installed)
Also if you have more than one project in a group file then you need to rerence each project that requires access to the objects.

Just curious but does the error message still happen if you remove withevents.

0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

771 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now