Using the WMI ODBC Adapter with Access

You can display WMI provider information through ODBC, using forms in Microsoft Access. You can use the same techniques to get information from any Windows Management Instrumentation (WMI) provider for applications that can access data using Open Database Connectivity (ODBC). The following steps describe how to use Access with the WMI ODBC adapter.

Note  For more information about support or requirements for installation on a specific operating system, see Operating System Availability of WMI Components.

The following procedure describes how to get data from WMI using Access and ODBC.

Aa393959.wedge(en-us,VS.85).gifTo get data from WMI using Access and ODBC

  1. From your Access database, click File, and then click Get External Data.
  2. Select Link Tables.
  3. In the Link dialog box, select ODBC Databases from the Files of type list.
  4. In the Select Data Source Tables dialog box, there are two tabs: File Data Source and Machine Data Source. If you have saved a file data source previously, you can select it from the File Data Source tab. Otherwise, click the Machine Data Source tab, and you can select either a previously setup machine data source, or the default machine data source WBEM Source. For more information about WBEM Source, see Installing the WMI ODBC Adapter.
  5. Click OK.
  6. In the Configure Connection dialog box, enter information for User Name, Password, Authority, Server name, and Locale. Usually this information is needed only when you get information from a remote WMI provider. If your Access database application gets data from your own computer, you may be able to leave these boxes blank.
  7. Click Connect.
  8. In the namespace selection pane, click the plus sign (+) next to the root node to expand the tree. Select the check box next to the CIMv2 namespace, and click OK.
  9. Click OK. Common Information Management (CIM) objects are represented as tables in the Link dialog box.
  10. Select an object about which to retrieve information, such as Win32LogicalDisk, and click OK.

    The WMI ODBC adapter displays the properties of CIM objects as if they were fields in a table. The Select Unique Record Identifier dialog box asks that you specify a unique property for each instance of the selected CIM object. In this case, the name of the drive is unique to each drive on a computer system and is stored in the field DeviceID.

  11. Select the unique field, and click OK. The new table is added to your database.

    The information in this linked table is updated each time you access it with a query or an Access form. However, you cannot manually edit any information in it because the WMI ODBC adapter provides read-only access only.

Note  There is a known issue with the improper display of 64-bit integers in Access 2000. Whereas Access 97 properly converts integers of type SQL_BIGINT (Sint64 or Uint64) into equivalent character strings, Access 2000 currently displays "box" characters for text strings converted from type SQL_BIGINT.