Ms-access import dll with backslash trailing in dll path

I expect to see a link to VBscript Regular Expressions 5.5 by adding the path c: \ windows \ system32 \ vbscript.dll \ 3 to ms-access via Tools> Links. However, the directory tree only shows the full path without the ending "\ 3"

What does "\ 3" (version number?) Mean, what is the correct name for it? How do I correctly add this link to my access project? Thanks.

+1


a source to share


2 answers


Better yet, don't include a link to it. Use the latest bind instead. This means that instead of the RegExp data types, you use the variables of the plain-vanilla object:

  Dim objRegEx As Object
  Set objRegEx = CreateObject("VBScript.Regexp")

      

This way, you don't have to worry about the version of the library installed on a particular computer. The difference in speed is very negligible for a single call, but if you intend to use it regularly, create a public function like this:

  Public Function RegEx() As Object
    Static objRegEx As Object

    If objRegEx Is Nothing Then
       Set objRegEx = CreateObject("VBScript.Regexp")
    End If
    Set RegEx = objRegEx
  End Function

      

Then you don't have to do anything - just use RegExp the same way you use a variable that points to your top level object. This will auto-initialize on first use and then persist until the application is closed.



If you are concerned about cleaning up before closing, you can do this:

  Public Function RegEx(Optional bolClose As Boolean = False) As Object
    Static objRegEx As Object

    If bolClose Then
       Set objRegEx = Nothing
       Exit Function
    End If
    If objRegEx Is Nothing Then
       Set objRegEx = CreateObject("VBScript.Regexp")
    End If
    Set RegEx = objRegEx
  End Function

      

And in your application shutdown program is called like this:

  Call RegEx(True)

      

And bob is your uncle!

+1


a source


bizl,

The \ 3 is a red herring.

To add a link to an Access project, open any code window, choose Links from the Tools menu, scroll down to the entry shown below and check it out.



Note that Location points to \ 3 even though the DLL is in the System32 directory. It has something to do with how Microsoft's version of the.

alt text http://www.windowsdevcenter.com/windows/2004/11/09/graphics/wrdh_0903.gif

+1


a source







All Articles