none
check access engine RRS feed

  • Question

  • hi

    When working on an Access database, a database engine must exist

    Microsoft Access Database Engine

    Is there a way with code vb.net to check the computer if it contains an engine  for Access databases


    • Edited by ahmeddc Thursday, May 9, 2019 6:43 PM
    Thursday, May 9, 2019 6:42 PM

Answers

  • Hello,

    The easiest method is to write a function that returns true if a connection could be made given a solid connection string for a known existing database.

    In the example below is simply a model to go by.

    Found here


    Please remember to mark the replies as answers if they help and unmarked 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.

    NuGet BaseConnectionLibrary for database connections.

    StackOverFlow
    profile for Karen Payne on Stack Exchange

    • Marked as answer by ahmeddc Thursday, May 9, 2019 9:39 PM
    Thursday, May 9, 2019 7:26 PM
    Moderator
  • They are normally installed with MSI

    So it can be checked with MsiQueryProductState

    For example, on my PC I have "Microsoft Access database engine 2010 (French)"

    and MsiQueryProductState with "{90140000-00D1-040C-1000-0000000FF1CE}"

    returns INSTALLSTATE_DEFAULT

    • Marked as answer by ahmeddc Thursday, May 9, 2019 9:39 PM
    Thursday, May 9, 2019 8:34 PM

All replies

  • Hello,

    The easiest method is to write a function that returns true if a connection could be made given a solid connection string for a known existing database.

    In the example below is simply a model to go by.

    Found here


    Please remember to mark the replies as answers if they help and unmarked 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.

    NuGet BaseConnectionLibrary for database connections.

    StackOverFlow
    profile for Karen Payne on Stack Exchange

    • Marked as answer by ahmeddc Thursday, May 9, 2019 9:39 PM
    Thursday, May 9, 2019 7:26 PM
    Moderator
  • They are normally installed with MSI

    So it can be checked with MsiQueryProductState

    For example, on my PC I have "Microsoft Access database engine 2010 (French)"

    and MsiQueryProductState with "{90140000-00D1-040C-1000-0000000FF1CE}"

    returns INSTALLSTATE_DEFAULT

    • Marked as answer by ahmeddc Thursday, May 9, 2019 9:39 PM
    Thursday, May 9, 2019 8:34 PM