Friday, November 8, 2013

Object library not registered error - MS ACCESS 97, VBScript, Windows 7 - WSH, Vista

Just to report a problem that I run into and hopefully this post can help someone that run into a similar problem.

The problem: Receive 'object library not registered' error when try to check referenced code in ACCESS 97 that references MS VBScript engine.

Suspected scope of the problem: This problem could also appear in code that was developed for other version of ACCESS on Windows Vista, XP or older operation system.
 
The sequel: I got some ACCESS 97 code that uses the regular expression object (RegExp) that was made available by Microsoft through the installation of Microsoft's VBScript engine (The latest version is the Windows Scripting Host version 5.7 and can be download from Windows Script 5.7 for Windows Server 2003). Recently, when I try to check the 'reference' (open a code module and -tools -reference) in ACCESS 97, I received the 'object library not registered' error and was not able to see the referenced object for the database.

Kernel of the problem: A reference to the 'VBScript Global' type library in Windows 7. Basically, in my old XP machine, I have to install the VBScript Engine so that the 'VBScript Global' COM (Component Object Model) object exist. But I did not do that on my Windows 7 machine.

The solution: After googling the web and found the Wikipedia article: Windows Script Host, it is clear that there is no VBScript Engine for Windows 7 to download. It should come with the Windows 7 machine. At that point, I was thinking maybe the RegExp is contained in other COM that I should reference. But I was failed to find one. In the end, I simply test the code: CreateObject("VBScript.RegExp") and it worked without me adding any reference in ACCESS.

The annoyance: Since the database is hosted on a network drive, I will have to add and remove the reference based on which machine I am using.
 

No comments:

Post a Comment