none
Accessing databases in HTA - Provider not found - ACE.OLEDB.12.0 RRS feed

  • Question

  • I have created an HTA which pulls client data from a local database.  I am using ACE.OLEDB.12.0 as the provider.  On the machine I used to write the HTA there are no problems.  I copied the HTA file to a second machine, but it always give me an error that the provider cannot be found.  I have confirmed that ACE 12.0 is installed on the second machine.  I have also written a standalone VBS file to test the database connection, and it runs perfectly with no errors.

    Anyone else experienced this where a VBS file can connect to a database, but the identical code in an HTA throws an error?

    Any suggestions would be helpful.

    (both machines running windows 7 pro.  machine that works is x86, problem machine is x64.)

    Tuesday, February 2, 2016 4:17 PM

Answers

  • On 64-bit Windows 10 I ran a simple HTML app by double clicking on the file and it loaded the 32-bit version of mshta.exe (in C:\Windows\SysWOW64):

    You will probably need to run it from a Command line or batch file and use "C:\Windows\System32\mshta.exe" (64-bit version) instead.


    Paul ~~~~ Microsoft MVP (Visual Basic)

    • Marked as answer by jason729 Wednesday, February 3, 2016 2:50 PM
    Wednesday, February 3, 2016 4:25 AM

All replies

  • If the code is running 64-bit then you will need to have the 64-bit ACE OLEDB Provider installed.

    Paul ~~~~ Microsoft MVP (Visual Basic)

    Tuesday, February 2, 2016 4:51 PM
  • My standalone vbscript works just fine using identical parameters.  Clearly the 64-bit version of ACE is installed.  The problem is that when the HTA tries to open the connection.
    Tuesday, February 2, 2016 5:23 PM
  • Where does the HTA code execute? IIS? Or, is it client-side code running from the browser only? Whatever your environment is, it is different than where your standalone VBScript is running. This could only mean that either they are running under different bitness, or there is a permissions issue when attempting to load the ACE OLEDB Provider.

    Paul ~~~~ Microsoft MVP (Visual Basic)

    Tuesday, February 2, 2016 10:40 PM
  • Thanks Paul.

    The HTA and the vbscript file are both being executed from the local desktop.  Everything is client-side.  No servers are involved.

    Is it possible that mshta.exe only exists as a 32-bit application and therefore cannot use the 64-bit version of ACE?

    Is there a way to determine if there is a permissions issue with the HTA in trying to access ACE?  If it is a permissions issue, is there a way to provision the HTA with the required permissions?

    Wednesday, February 3, 2016 2:43 AM
  • On 64-bit Windows 10 I ran a simple HTML app by double clicking on the file and it loaded the 32-bit version of mshta.exe (in C:\Windows\SysWOW64):

    You will probably need to run it from a Command line or batch file and use "C:\Windows\System32\mshta.exe" (64-bit version) instead.


    Paul ~~~~ Microsoft MVP (Visual Basic)

    • Marked as answer by jason729 Wednesday, February 3, 2016 2:50 PM
    Wednesday, February 3, 2016 4:25 AM
  • Interesting that it would default to the 32-bit version of mshta on a 64-bit system.  I will try running the HTA from command line and see if that solves the problem.

    Thanks

    Wednesday, February 3, 2016 4:42 AM
  • That did it!  Running the HTA from command line, forcing the system to use the 64-bit version of mshta.exe worked perfectly, as long as you use the full file path for the database file you want to connect to.

    Thanks Paul!

    Wednesday, February 3, 2016 2:46 PM