In this VB.Net Tutorial/Code Example, I’m going to provide you with a simple class that allows for you to check whether Access is installed on the computer and also figure out which version of the Access it is.

The version function uses late binding.

Imports Microsoft.Win32

Namespace MS.Office
    Public Class Access
        Public Shared Function isInstalled() As Boolean
            Dim regClasses As RegistryKey = Registry.ClassesRoot
            Dim rtn As Boolean
            Dim reg As RegistryKey = regClasses.OpenSubKey("Access.Application")
            If reg Is Nothing Then
                rtn = False
            Else
                rtn = True
            End If
            reg.Close()

            Return rtn
        End Function

        Public Shared Function version() As String
            Dim rtn As String = ""
            Dim objApp As Object

            If isInstalled() Then
                objApp = CreateObject("Access.Application")
                rtn = objApp.Version
            End If

            Return rtn
        End Function
    End Class
End Namespace
Is Access installed and what version?
Tagged on:

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.