Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Active-X Objects

Status
Not open for further replies.
Nov 24, 2003
57
US
I just added a gif animation active-x control, which isn't part of the standard Access active-x objects and I'll be placing the database on the network in a multi-user environment where everyone will be using the same front-end. My question is since this isn't a standard active-x control, will I need to go to everyone's computer and place the active-x object on their machines or will it work alright? If it's a matter of having to place it on everyone's machine, does anyone know an easy way to do this without having to go to everyone's computer?
 
Hi AccessHawai,

You can write code in VBA to do this for you. I use the following (...think I got it from Microsoft.com):

Option Compare Database

Public Declare Function OCX_NAME Lib "replace_this_text_with_the_Pathname_to_the_OCX_file" Alias "DllRegisterServer" () As Long
Public Const S_OK = &H0

Sub RegisterOCX()
On Error GoTo Err_Registration_Failed
If OCX_NAME = S_OK Then
'MsgBox "Registered Successfully"
Else
MsgBox "Registered UNsuccessfully."
DoCmd.Quit acQuitSaveNone
End If
Exit Sub
Err_Registration_Failed:
MsgBox "Error: " & Err.Number & " " & Err.Description
End Sub

Sub UnRegisterOCX()
On Error GoTo Err_Unregistration_Failed
If OCX_NAME = S_OK Then
'MsgBox "Unregistered Successfully"
Else
MsgBox "Not Unregistered"
End If
Exit Sub
Err_Unregistration_Failed:
MsgBox "Error: " & Err.Number & " " & Err.Description
End Sub

'Call this function from a startup form

Good luck

Maarten


 
Thanks, Maarten. When this code runs does it permanently register the active-x control to the user's machine or is it just temporary for that session? I'm guessing permanent but just want to make sure.

The active-x control I'm using is on a splash screen, which is the start-up form. Do you think placing the code in this form would work or would it be better to use a hidden form with the code as the start-up and have it close on a timer event and then open the splash screen with the active-x control?

Thanks for the help.
 
Actually, I haven't checked if it is permanently or not (but I think your guess is right). The users are bothered with the registration every time the start the database. This is very quick however, and saved me from creating functionality detecting a registered ocx or not (which is of course nicer and better to have).
I can't think of anything against working the way yy suggest (on your startup form). I do the same thing (disabling the mouse scroll button) , but it becomes operational (not!) on a second form. I guess you have to try it out.

good luck.<
<
Maarten
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top