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
Solved

activex error

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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

791 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