DataRecordsets Collection

The collection of DataRecordset objects associated with a Document object.

Note

This Visio object or member is available only to licensed users of Microsoft Visio Professional 2010 or Visio Premium 2010.

Remarks

The default property of the DataRecordsets collection is Item.

Every Visio Document object has a DataRecordsets collection, which is empty until you import data into Visio. To connect a Visio document to a data source, you add a DataRecordset object to the DataRecordsets collection of the document.

To add a DataRecordset object to the DataRecordsets collection, you can use one of the following three methods, depending on the type of data source you want to connect to (OLEDB/ODBC or XML) and how you want to pass connection string and query command strings to Visio. By using the

  • DataRecordsets.Add method, you can connect to an OLEDB or ODBC data source and pass connection and query command string information to Visio directly as method parameters.

  • DataRecordsets.AddFromConnectionFile method, you can connect to an OLEBD or ODBC data source by passing the method an Office Data Connection (ODC) file that contains the connection and query command string information you want to supply to Visio.

  • DataRecordsets.AddFromXML method, you pass the method an ADO classic XML string that contains all the data that you want to include in the data recordset.

Once you have created a data recordset, the connection string and query command string associated with the data recordset are represented by the DataConnection.ConnectionString and DataRecordset.CommandString properties respectively.