I have an application (2007/accdb) which uses the MS OLE File Property Reader for some of its functions. The DSO Dll file is included as a reference (see illustration). The C:\DsoFile folder is the default location that the MSI installs the reader to.
Currently not all of the users have this utility installed. When the application is started, a check is made for the existence of the C:\DsoFile folder. If it isn't found, a flag is set.
All code related to the OLE File Property Reader is isolated in its own module. If the forementioned flag indicates the reader is not installed, none of the functions in the OLE File Property Reader module are called.
My hope was that so long as none of the code referring to the reader was executed on a PC where the reader wasn't installed, I wouldn't get an error. This is not turning out to be the case. if the computer doesn't have the reader installed, I am getting an error when the app first starts up on the following:
strWorkStation = Environ("ComputerName")
Specifically, the command 'Environ' isn't found.
As soon as I remove the 'missing' reference to the DSO OLE File Property Reader, everything starts up OK.
I recognize that all I need to do to work around this, is add the reference programmatically, should I need it. But I just wanted to confirm that my assumption about not getting a runtime error for a missing library if the library objects are not referenced was completely wrong.
Or is there another workaround?