dcsimg
Results 1 to 5 of 5

Thread: How to determine if ACE.OLEDB.16.0 provider is registered on the user machine or not?

  1. #1

    Thread Starter
    Hyperactive Member Joye's Avatar
    Join Date
    Jul 2009
    Posts
    256

    How to determine if ACE.OLEDB.16.0 provider is registered on the user machine or not?

    So my program needs ACE.OLEDB.16.0 provider to be registered on users machine and I want to know if he already has it or not so I can install it for him from my project installer.

    How can I detect that programmatically?

  2. #2
    Super Moderator dday9's Avatar
    Join Date
    Mar 2011
    Location
    South Louisiana
    Posts
    9,544

    Re: How to determine if ACE.OLEDB.16.0 provider is registered on the user machine or

    You can use the Registry class to attempt to get it and set the default value to Nothing, that away if nothing is returned then you know it isn't registered. Without testing it, I think something like this would work:
    Code:
    Dim ace_registry As Object = Microsoft.Win32.Registry.GetValue("HKCR", "Microsoft.ACE.OLEDB.16.0", Nothing)
    If ace_registry Is Nothing Then
        'Not registered
    End If

  3. #3

    Thread Starter
    Hyperactive Member Joye's Avatar
    Join Date
    Jul 2009
    Posts
    256

    Re: How to determine if ACE.OLEDB.16.0 provider is registered on the user machine or

    Quote Originally Posted by dday9 View Post
    You can use the Registry class to attempt to get it and set the default value to Nothing, that away if nothing is returned then you know it isn't registered. Without testing it, I think something like this would work:
    Code:
    Dim ace_registry As Object = Microsoft.Win32.Registry.GetValue("HKCR", "Microsoft.ACE.OLEDB.16.0", Nothing)
    If ace_registry Is Nothing Then
        'Not registered
    End If
    I tried it this way:

    Code:
    Public Class Form1
        Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
            Dim ace_registry As Object = Microsoft.Win32.Registry.GetValue("HKCR", "Microsoft.ACE.OLEDB.16.0", Nothing)
            If ace_registry Is Nothing Then
                Label1.Text = "Not Registered"
            Else
                Label1.Text = "ACE Provider 16.0 Registered"
            End If
        End Sub
    End Class
    then this showed up :

    Name:  Ace Provider.png
Views: 207
Size:  27.2 KB

  4. #4
    Super Moderator dday9's Avatar
    Join Date
    Mar 2011
    Location
    South Louisiana
    Posts
    9,544

    Re: How to determine if ACE.OLEDB.16.0 provider is registered on the user machine or

    I'm not sure what the base key name is, I was just taking a guess. Do a quick Google search on "Microsoft.ACE.OLEDB.16.0 base key name" and see what the result is; I'd do it for you but I'm leaving the office in about 5 minutes.

  5. #5
    .NUT jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    104,181

    Re: How to determine if ACE.OLEDB.16.0 provider is registered on the user machine or

    You shouldn't need to check yourself. You should create a prerequisite package for the installer and then add that to your own setup. The checking can then be done automatically.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width