There was a problem accessing a property or method of the OLE object

darbid

Registered User.
Local time
Today, 07:56
Joined
Jun 26, 2008
Messages
1,428
Sometime programming is really annoying. I have a dll/active X problem on my computer. It appears to be localised on my computer.

For many months now I have been using the DTPICKER which is mscomct2.ocx.

Because this is not on all computers I have code to copy it to the client and then with a bat file register it. I was reworking this code today and to test i was deleting the ocx. (this i think is the cause of my problem)

So now when i open the form where the DTPicker is I get
There is no object in this control
If I try to add a new DTPicker i get
There was a problem accessing a property or method of the OLE object
I have tried to unregister and register this ocx but this has not helped.

Could anyone please give me some help.
 
yeh that is what i meant by unregister/register but to explain i did it like this.

unregistered
delete the ocx
copy the ocx to System32
register

did not help
 
We had some problems with this control on just some of our computers, it was a version issue. They had some parts of Office 2007 installed ahead of the full Office 2007 deployment. So you might check that you have the correct version of the control for the Office version you are using.
 
The windows registry sacres me but I have found this

This is the CLSID for the DTPICKER and the path is correct.
HKEY_CLASSES_ROOT\CLSID\{20DD1B9E-87C4-11D1-8BE3-0000F8754DA1}
But what is this? It is also named DTPICKER and has the same path
Code:
HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{4D588145-A84B-4100-85D7-FD2EA1D19831}
What is even more strange if I unregister the ocx the first one above is gone from the registry but the second stays.

Could this be the problem?
 
could someone maybe recommend a registry cleaner as it seems that by deleting the ocx I have caused some problems.
 
Sorry, I don't have a solution for you, but this is one reason why I will go to almost ANY lengths to NOT use any ActiveX controls in my databases. Things are just too "fragile" around that and not all users might have them and even if they do, sometimes there are problems. So, unless there is no alternative, I will use no ActiveX controls in my databases and I suggest the same. There are non-ActiveX control solutions out there - for example, a calendar control I use:

http://www.access-programmers.co.uk/forums/showthread.php?t=103387
 
The Solution - at least for me.

ANY lengths to NOT use any ActiveX controls in my databases.
I know I know. Thanks for writing and showing your support in my time of "shit I think I have stuffed my registry". It is to late for me but maybe one day I will take these off and put in a non active x control.

Things are just too "fragile" around that and not all users might have them and even if they do, sometimes there are problems.
This is right.

So to make this thread complete here is one solution (it might not be THE solution) but it worked for me. Do all these things with caution as you are playing with fire at a gas station (tankstelle, servo) whenever you do things with the windows registry.

First you must recognise the problem which we are solving. You have deleted a .dll or .ocx without unregistering it and then added the file again (maybe an older or newer version) and registered it. Or a program has registered the same .dll or ocx twice.

You are then getting an error when you try to use the ActiveX control on your MSAccess forms. Like what I have detailed in previous posts.

Most likely the problem is that your registry has multiple entries of the same .dll or ocx. To establish this fact I did a little search of my registry and found out what I have showed in the previous posts. You will also find things on the internet about this as well.

One solution here (once again this is what I did I am not recommending it as THE solution) is to use a registry cleaner like RegClean. I first had to delete these files from my System32 folder and then let the regclean, clean my registry. It found the multiple entries in the registry and tagged them for deletion. I accepted the recommendations of RegClean (but do not do this blindly).

I then rebooted.

I then put my .OCX mscomct2.ocx back in System32 and registered it from the CMD with "regsvr32 <pathtoocx>.

When I opened MSACCESS the problems I outlined above were GONE. YEH. But this introduced a new problem. Access said that the OLE Server was not registered and to reinstall it. I did this and nothing worked.

So doing some more reading you will find that mscomct2.ocx and mscomctl.ocx seem to be related. In may case I had STUPIDLY deleted my original OCX's. But for good measure anyway I thought I would get the newest versions from Microsoft.

Check the OCX's for these files are not in your system32. Do another RegClean which deletes the references to these files. (just in case they are still there)

Then I "installed" the below.

http://www.microsoft.com/downloads/...98-51D0-41C1-BB14-64662F5F62FE&displaylang=en is for the mscomctl.ocx

http://support.microsoft.com/kb/297381 for mscomct2.ocx

Reboot.

Then they work in MSACCESS again. YEH
 
Sorry, I don't have a solution for you, but this is one reason why I will go to almost ANY lengths to NOT use any ActiveX controls in my databases.
I had yet another problem with mscomct2.ocx and I have finally taken your advice and removed them from my forms.

People if you are reading this take the advice of people like bob and many others - do not even start with such ActiveX controls unless you really really have to use them. They are difficult to use - you have to watch compatibility if you are distributing your front end - updates to your computer or others may change the OCX or DLL's and then cause problems and the whole registering unregistering of these dam things can just lead to problems.

Try your best to avoid them. I am now rewriting code to get rid of me datetimepicker.
 

Users who are viewing this thread

Back
Top Bottom