|Important||This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here. ArchiveDisclaimer|
ADOAdapterObject Interface (Microsoft.Office.Interop.InfoPath.SemiTrust)
Assembly: Microsoft.Office.Interop.InfoPath.SemiTrust (in microsoft.office.interop.infopath.semitrust.dll)
This type is a wrapper for a coclass that is required by managed code for COM interoperability. Use this type to access the members of the COM interface implemented by this coclass. For information about the COM interface, including a link to descriptions of its members, see ADOAdapter2.
The ADOAdapter object is a type of Microsoft Office InfoPath 2007 data adapter that contains all the information necessary for retrieving and submitting data to an external data source.
The ADOAdapter object provides properties that can be used to get and set information about the data adapter's connection string, SQL command text, and timeout value. It also provides a method for creating a SQL command text fragment based on a specified XML node's attributes.
// retrieve the Employees Adapter from the DataAdapters collection ADOAdapter employeesDA=(ADOAdapter)thisXDocument.DataAdapters["Employees"]; // get employee’s ID from the main DOM string employeeID=thisXDocument.DOM.selectSingleNode("//my:field2").text; // Change the ADOAdapter’s command to retrieve the record of the Employee’s ID entered // by the user employeesDA.Command="select * from Employees where EmployeeID="+employeeID; // get DataObject from the DataObjects collection and call Query to refresh // the data object DataObject employeesDO=thisXDocument.DataObjects["Employees"]; employeesDO.Query();