DataConnection object (Visio)

Abstracts communication between one or more DataRecordset objects and a non-XML data source.


This Visio object or member is available only to licensed users of Visio Professional 2013.


The default property of the DataConnection object is ID.

When you add a new DataRecordset object to the DataRecordsets collection (by using a method other than DataRecordsets.AddFromXML) and you don't specify an existing DataConnection object (by passing the connection string associated with it to the DataRecordsets.Add method), Visio creates a new DataConnection object.

The DataConnection object exposes properties that make it possible to access data-source connection settings:

  • The ConnectionString property gets or sets the connection string used to access an existing DataConnection object or to create a new DataConnection object. Note that setting this property to a new value does not immediately change the connection; Visio re-evaluates this property only when the DataRecordset.Refresh method is called.

  • The Timeout property determines how long (in seconds) Visio should attempt to establish a data-source connection before terminating the connection attempt and generating an error. The default is 15 seconds.

  • The FileName property gets or sets the name of the Office Data Connection (ODC) file that contains the data-source connection and query information used to create a new connection and to refresh data from an existing connection.

Multiple DataRecordset objects can share the same DataConnection object. When any of the data recordsets that share a data connection are refreshed, all are refreshed.


Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.