Share via


ADOAdapterObject interface

Represents a connection to a Microsoft ActiveX Data Objects/OLEDB data source.

Namespace:  Microsoft.Office.Interop.InfoPath
Assembly:  Microsoft.Office.Interop.InfoPath (in Microsoft.Office.Interop.InfoPath.dll)

Syntax

'Declaration
<GuidAttribute("096CD5D3-0786-11D1-95FA-0080C78EE3BB")> _
Public Interface ADOAdapterObject _
    Inherits ADOAdapter2
'Usage
Dim instance As ADOAdapterObject
[GuidAttribute("096CD5D3-0786-11D1-95FA-0080C78EE3BB")]
public interface ADOAdapterObject : ADOAdapter2

Remarks

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, seeADOAdapter2.

The ADOAdapter object is a type of Microsoft InfoPath 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.

If an ADO/OLEDB data source is used as the primary data source for a form, the ADOAdapter object is accessible through the QueryAdapter property of the XDocument object.

Examples

// 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();

See also

Reference

ADOAdapterObject members

Microsoft.Office.Interop.InfoPath namespace