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.
To get data from WMI using Access and ODBC
- From your Access database, click File, and then click Get External Data.
- Select Link Tables.
- In the Link dialog box, select ODBC Databases from the Files of type list.
- 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.
- Click OK.
- 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.
- Click Connect.
- 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.
- Click OK. Common Information Management (CIM) objects are represented as tables in the Link dialog box.
- 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.
- 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.
Build date: 11/19/2012