none
Detect installed Access from Visual Studio 2017 RRS feed

  • Question

  • Hi, please can somebody help me how i detect from Visual Basic -  installed version Access (full or runtime) ?

    Something as : If x.... msgBox("Runtime") ... MsgBox(Full Access)

    Very thank for help ! vaclav

    Wednesday, January 9, 2019 2:16 PM

Answers

  • Hi Kyssling,

    Welcome to the MSDN forum.

    It seems your issue is about the VB development and our forum is to discuss the VS IDE, I will help you move this thread to the appropriate forum for a better support, thank you for your understanding.

    Best regards,

    Sara


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com

    • Marked as answer by Kyssling Thursday, January 17, 2019 12:59 PM
    Thursday, January 10, 2019 3:04 AM
  • Hi,

    Do you resolve the issue? If you resolve the issue,please mark the helpful as answer.

    Best Regards,

    Alex


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Marked as answer by Kyssling Thursday, January 17, 2019 12:59 PM
    Thursday, January 17, 2019 6:15 AM

All replies

  • Hi Kyssling,

    Welcome to the MSDN forum.

    It seems your issue is about the VB development and our forum is to discuss the VS IDE, I will help you move this thread to the appropriate forum for a better support, thank you for your understanding.

    Best regards,

    Sara


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com

    • Marked as answer by Kyssling Thursday, January 17, 2019 12:59 PM
    Thursday, January 10, 2019 3:04 AM
  • Hi,

    VBA code:

     If SysCmd(acSysCmdRuntime) = False Then
            
    MsgBox("Runtime")
        Else
           
    MsgBox("Full Access")
        End If

    https://docs.microsoft.com/en-us/office/vba/api/access.application.syscmd

    If you want to use vb.net, you can try the following code:

    Public Class Form1
        Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
    
            If Microsoft.Office.Interop.Access.AcSysCmdAction.acSysCmdRuntime Then
    
            Else
    
            End If
    
        End Sub
    End Class

    Best Regards,

    Alex


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Thursday, January 10, 2019 3:29 AM
  • Hello,

    The following will determine if Access is installed.

    Public Class Form1
        Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
            Dim result = IsAccessInstalled()
            If result Then
                MessageBox.Show("Access is installed")
            Else
                MessageBox.Show("Access is not installed")
            End If
        End Sub
        Public Function IsAccessInstalled() As Boolean
            Dim officeType As Type = Type.GetTypeFromProgID("Access.Application")
            If officeType Is Nothing Then
                Return False
            Else
                Return True
            End If
        End Function
    End Class
    


    Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.
    VB Forums - moderator
    profile for Karen Payne on Stack Exchange, a network of free, community-driven Q&A sites

    Thursday, January 10, 2019 10:38 AM
    Moderator
  • Hi all, very thanks for yours advice, but does not functioning :-(

    For better understanding ... I have on target computers installed MS Access 2010 Runtime OR MS Access 2010 Full application.

    I try your examples on Windows 7 computers with Full Access (return Access is installed) on Runtime return same (Access is installed) ...

    I need different work on my program if Runtime or Full Access ...

    Any next idea ? Very thanks ! Vaclav


    Friday, January 11, 2019 9:45 AM
  • Hi all, very thanks for yours advice, but does not functioning :-(

    For better understanding ... I have on target computers installed MS Access 2010 Runtime OR MS Access 2010 Full application.

    I try your examples on Windows 7 computers with Full Access (return Access is installed) on Runtime return same (Access is installed) ...

    I need different work on my program if Runtime or Full Access ...

    Any next idea ? Very thanks ! Vaclav


    I have nothing else as what I provided is working on about 900 computers on Windows 10 and have verified this with Windows 7 coded under Visual Studio 2017.

    Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.
    VB Forums - moderator
    profile for Karen Payne on Stack Exchange, a network of free, community-driven Q&A sites

    Friday, January 11, 2019 9:51 AM
    Moderator
  • Okay now I'm curious about your environment. Please run the following and report back what is written to the IDE output window.

    Dim oledb12Installed = (New OleDb.OleDbEnumerator()).
            GetElements().AsEnumerable()
    
    For Each row As DataRow In oledb12Installed
        Console.WriteLine(row.Field(Of String)("SOURCES_NAME"))
    Next


    Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.
    VB Forums - moderator
    profile for Karen Payne on Stack Exchange, a network of free, community-driven Q&A sites

    Friday, January 11, 2019 10:20 AM
    Moderator
  • Hi ! Very thanks for yours time and advices. Here is result :

    Win7 Pro 64Bit+Office 2010 Pro (include full Access 2010) :
    SQLOLEDB
    MSOLAP
    MSOLAP
    MSDataShape
    SQLNCLI11
    Microsoft.ACE.OLEDB.12.0
    ADsDSOObject
    SQLNCLI11 Enumerator
    Windows Search Data Source
    SSISOLEDB
    MSDASQL
    MSDASQL Enumerator
    Microsoft.Jet.OLEDB.4.0
    SQLOLEDB Enumerator
    MSDAOSP
    MSDAORA
    MSIDXS
    MSOLAP
    MSOLAP

    Win7 Pro 64Bit+Office 2010 Stnd (include Access 2010 RUNTIME) :
    SQLOLEDB
    MSOLAP
    MSOLAP
    MSDMine
    MSDataShape
    Microsoft.ACE.OLEDB.12.0
    ADsDSOObject
    MSDMine Enumerator
    Windows Search Data Source
    MSOLAP
    MSOLAP
    MSOLAP
    MSOLAP
    MSDAIPP.DSO
    MSDASQL
    MSDASQL Enumerator
    Microsoft.Jet.OLEDB.4.0
    SQLOLEDB Enumerator
    MSDAOSP
    MSDAORA
    MSIDXS

    Monday, January 14, 2019 11:59 AM
  • Okay, what this means is MS-Access itself is not installed else my original code would have gotten it. Instead what I see in your last reply tells me is that OleDb data provider is installed and no MS-Access full edition so in this case you are safe to run VB.NET code to access a database.

    Here I target Access data provider for 2007 and higher.

    Public Class Form1
        Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
            ' test for 2007 and higher
            Dim accessproviderInstalled = (New OleDb.OleDbEnumerator()).
                    GetElements().AsEnumerable().
                    FirstOrDefault(Function(row) row.Field(Of String)("SOURCES_NAME") = "Microsoft.ACE.OLEDB.12.0")
    
            If accessproviderInstalled IsNot Nothing Then
                MessageBox.Show("Access provider is installed")
            Else
                MessageBox.Show("Access provider is not installed")
            End If
    
        End Sub
    End Class
    


    Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.
    VB Forums - moderator
    profile for Karen Payne on Stack Exchange, a network of free, community-driven Q&A sites

    Monday, January 14, 2019 12:22 PM
    Moderator
  • Hi thanks for patiente, as i write above on result :

    Microsoft.ACE.OLEDB.12.0 is on computer with Full Ofiice PRO (with MS ACCESS)
    and on other computer with Office Standard (with Access Runtime).

    So same result on runtime i have "Access Provider installed" ...

    I need different procedures on my program if installed : Runtime OR Full Access.

    Monday, January 14, 2019 3:49 PM
  • You can do similar/simpler tests as MS ROISCAN script (it mainly reads registry + WMI)

    On my OS, when Access Runtime is installed, it adds a key in : HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall

    (AccessRuntimeRetail-en-us for us version for example)

    Monday, January 14, 2019 4:15 PM
  • Thank you for tip !

    So better for me, i will write next (similar code)
    (On Runtime we use "Get object")

    MSAnswer

    On Error Resume Next
    Set oAccess = CreateObject("Access.Application")
    If Err.number<>0 then
       MsgBox "Starting under Runtime", vbOKonly
    end if

    So thank you for tips and time !
    Have nice day !
    Vaclav

    Tuesday, January 15, 2019 1:42 PM
  • Hi,

    Do you resolve the issue? If you resolve the issue,please mark the helpful as answer.

    Best Regards,

    Alex


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Marked as answer by Kyssling Thursday, January 17, 2019 12:59 PM
    Thursday, January 17, 2019 6:15 AM