Registering MSCOMCTL2.ocx (1 Viewer)

TKnight

Registered User.
Local time
Today, 09:40
Joined
Jan 28, 2003
Messages
181
Hi,

I have a database that uses the date picker control from MSCOMCTL2.ocx

The problem is that in earlier versions I used a calendar control and not everyone has the OCX on their machine.

I put the file in a self extracting zip file which unzips the OCX to their system32 directory and e-mailed it to all users of the DB.

For some people this worked fine and they can use the control. For others it will not appear on the forms. I checked their system32 directory and the OCX file is in there but access won't recognise it for some reason. If I go to their machine and create a blank DB. Browse for the OCX and add it as a reference, my FE MDE will then work. This unfortunately means I have to visit every users machine though, so i'm looking for a more instant solution if possible. I have an auto-update facility for the FE's so any change I make can be rolled out to users from my machine.

I found some code on here to register a library and I put the OCX in a public place where it would hopefully register (with an error trap if it was already registered)

Code:
Set rfs = Application.References
strMSCOM2path = "H:\ECM_DB\DLLs\MSCOMCT2.OCX"
If fso.FileExists(strMSCOM2path) Then
   Set rf = rfs.AddFromFile(strMSCOM2path)
Else
   Err.Raise 40001, , "The file '" & strMSCOM2path & "' was not found. This may cause the DB to function improperly."
End If

...This worked in the MDB version of the DB but when I rolled out the FE (MDE) it generated an error "40179: The file is not a library or MDE".
I'm guessing only DLLs can be registered that way not OCXs but i'm not sure.

Does anyone know how I can sort this problem out?

Thanks,

Tom
 

Users who are viewing this thread

Top Bottom