Error -2146824582: User-defined Error Code with TestStand 64-bit

Updated Jan 22, 2020

Reported In

Software

  • TestStand

Issue Details

I would like to log to an access database, such as the provided TestStand Results.mdb database, with a 64-bit version of TestStand, but I receive the following error when I execute my sequences with database logging enabled: 

-2146824582; User-defined Error Code
A 64 bit version of the database provider, MICROSOFT.ACE.OLEDB, required for this file type is absent in this machine. Install this provider or specify a connection string that uses a different provider in the New Data Link Dialog.
Refer to the "Using Access Database with TestStand 64 bit" knowledge base article for more information on how to resolve this error.
Provider cannot be found. It may not be properly installed.
Source: TSDBLog 


Solution

This error occurs because 64-bit Windows does not include a 64-bit version of the Jet OLE DB provider required for connecting to Access. 64-bit TestStand does not install any Access provider because the available 64-bit Access provider cannot be installed concurrently with 32-bit versions of Microsoft Office. Use the methods outlined in this document to use database logging in 64-bit TestStand.

Method 1: Use another database solution, such as SQL Server (NI Recommended)
The Jet OLE DB provider and the Microsoft Access ODBC driver (Jet ODBC driver) have been deprecated by Microsoft and there is no 64-bit version available. In place of Microsoft Jet, Microsoft recommends using Microsoft SQL Server Express Edition or Microsoft SQL Server Compact Edition for applications outside of Microsoft Access which need to store data in a database. Once you have installed the database solution of your choice, go to Configure>>Result Processing>>Database Options and update the Connection String Expression accordingly.

Method 2: Use the Microsoft Access Database Engine 2010 Redistributable
Users who want to use the Access database for database operations in TestStand 64-bit can download and install the 64-bit version of the Microsoft Access Database Engine 2013 Runtime. Since the 64 bit Microsoft Access Database Engine cannot be installed in a machine that already has a 32-bit version of Microsoft Office installed, Microsoft and National Instruments do not recommend this approach as a general replacement for Access Jet. This provider can be used for all database related operations in TestStand 64-bit. 
  1. Remove any 32-bit Microsoft Office installation.
  2. Download and install the executable named AccessRuntime_x64_en-us.exe from this location.
  3. Go to Configure>>Result Processing>>Database Options and update the Connection String Expression to point to the new DB provider.
Use the following connections strings for connecting to Access (.mdb and .accdb files) in 64-bit TestStand:

Ole DB 
Syntax: Provider=Microsoft.ACE.OLEDB.15.0;Data Source= <path to mdb/accdb file>;Persist Security Info=False;
Example: Provider=Microsoft.ACE.OLEDB.15.0;Data Source=C:\Program Files\National Instruments\TestStand 2014\Components\Models\TestStandModels\Database\TestStand Results.mdb;Persist Security Info=False;

ODBC
Syntax: 
Driver={Microsoft Access Driver (*.mdb, *.accdb)};DBQ=<path to mdb/accdb file>
Example: Driver={Microsoft Access Driver (*.mdb, *.accdb)};DBQ=C:\Program Files\National Instruments\TestStand 2014\Components\Models\TestStandModels\Database\TestStand Results.mdb

Connection string for connecting to DBASE files in TestStand 64 bit
Syntax: 
Driver={Microsoft Access dBASE Driver (*.dbf, *.ndx, *.mdx)};Dbq=<Directory of dbf file>
Example: Driver={Microsoft Access dBASE Driver (*.dbf, *.ndx, *.mdx)};Dbq=C:\TestFolder  
 

Additional Information

Notes:
  • Microsoft’s Jet OLE DB provider is the default provider used for database interaction with Microsoft Access in 32-bit TestStand. You can log to the Access database in 32-bit TestStand using this provider.
  • The  Microsoft Access Database runtime mentioned in Method 2 includes the Microsoft Office 15.0 Access Database Engine OLE DB (Microsoft.ACE.OLEDB.15.0) provider for Access as well as the Access ODBC drivers.