AdoQueryConnection Class (Microsoft.Office.InfoPath)

Represents a connection for retrieving data from a Microsoft Access or Microsoft SQL Server database.

Namespace: Microsoft.Office.InfoPath
Assembly: Microsoft.Office.InfoPath (in microsoft.office.infopath.dll)

Syntax

'Declaration
Public MustInherit Class AdoQueryConnection
    Inherits DataConnection
'Usage
Dim instance As AdoQueryConnection
public abstract class AdoQueryConnection : DataConnection

Remarks

The ADOQueryConnection object provides properties that can be used to get and set information about the data connection'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.

When a form designer creates a form template using the New from Data Connection link on the Design a Form task pane, and then selects to create a Database connection, an AdoQueryConnection object for this connection is added to the DataConnectionCollection collection.

If the form designer also enables submitting to this ADO connection, then an AdoSubmitConnection object for this connection is added to the DataConnectionCollection collection.

For both kinds of connection, the name of each connection is specified by the form designer in the Data Connection Wizard user interface. The default names assigned in the wizard for each kind of connection are "Main connection" (AdoQueryConnection) and "Main connection submit" (AdoSubmitConnection).

The AdoQueryConnection class corresponds to the AdoAdapterObject class of the Microsoft Office InfoPath 2003 object model for a connection that is configured to retrieve (query) data from an Access or SQL Server database.

Inheritance Hierarchy

System.Object
   Microsoft.Office.InfoPath.DataConnection
    Microsoft.Office.InfoPath.AdoQueryConnection

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also

Reference

AdoQueryConnection Members
Microsoft.Office.InfoPath Namespace