(re-)Registering DLLs/References for Runtime Deployment

willknapp

Registered User.
Local time
Today, 10:03
Joined
Aug 16, 2012
Messages
93
I'm deploying an Access 2007 front end application as a runtime application (.ACCDR), and I'm using a few non-standard reference libraries in the VBA.

When I package the database into the .ACCDR file, do the reference libraries get bundled, or do I need to add references to them on the user's workstations? What if the DLLs don't exist on the user's workstations?

I've added all the .dll files to a support subfolder that gets added during the installation process, so they will be available if necessary.

Then, I've created a function on the startup form that will go through the DBs references, check to see if the necessary references are included and, if not, add them from the file.

Code:
Public Function AddReference(strName As String, strFile As String) As Boolean
    Dim myRefs As References
    Dim chkRef As Reference
 
    Set myRefs = Access.Application.References
    ' Check if the .dll is already added
    For Each chkRef In myRefs
        If chkRef.Name = strName Then
            ' Do Nothing
        Else
            ' Add the reference
 
[COLOR=red]           ' Will the Shell command below cause a problem if the DLL is already registered?[/COLOR]
            Shell ("regsvr32 /s """ & strFile & """")
 
            myRefs.AddFromFile strFile
        End If
    Next
 
End Function

Will this re-register the dlls in the Windows registry, and if so, will that cause any problems?
 
http://sourcedaddy.com/ms-access/updating-references.html
I was searching for the IsBroken property, this site seems to cover the subject.
It should get you pointed in the right direction.
Please be sure to post your best code solution and mark the thread as [solved] if you feel it is worth sharing.
 

Users who are viewing this thread

Back
Top Bottom