Solved

activex error

Posted on 2003-12-08
1
191 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
[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
1 Comment
 
LVL 3

Accepted Solution

by:
TimW1 earned 50 total points
ID: 9902519
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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
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 Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…

730 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