Solved

activex error

Posted on 2003-12-08
1
188 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
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
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 …
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…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

920 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

15 Experts available now in Live!

Get 1:1 Help Now