Go Back   Access World Forums > Microsoft Access Discussion > Modules & VBA

 
Reply
 
Thread Tools Rate Thread Display Modes
Old 05-27-2009, 09:06 AM   #1
TKnight
Registered User
 
Join Date: Jan 2003
Location: London
Posts: 181
Thanks: 0
Thanked 0 Times in 0 Posts
TKnight
Registering MSCOMCTL2.ocx

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

TKnight is offline   Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Using a DLL without registering it NPhillips Modules & VBA 0 03-18-2008 10:55 AM
Referencing a Column AND registering Data in a table Jotun Forms 6 08-14-2007 09:21 AM
buttons not registering on dbase sha7jpm General 6 09-29-2003 03:24 AM
Registering ActiveX rube Modules & VBA 0 07-19-2003 05:51 PM
Registering Libraries sush Modules & VBA 1 06-16-2000 07:32 AM




All times are GMT -8. The time now is 11:18 AM.


Microsoft Access Help
General
Tables
Queries
Forms
Reports
Macros
Modules & VBA
Theory & Practice
Access FAQs
Code Repository
Sample Databases
Video Tutorials

Sponsored Links

How to advertise

Media Kit


Powered by vBulletin®
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
(c) copyright 2017 Access World