DataRecordset.Name Property

Visio Automation Reference

Gets or sets the display name of the data recordset. Read/write.

ms426149.vs_note(en-us,office.12).gif  Note
This Visio object or member is available only to licensed users of Microsoft Office Visio Professional 2007.

Version Information
 Version Added:  Visio 2007

Syntax

expression.Name

expression   A variable that represents a DataRecordset object.

Return Value
String

Remarks

The display name of a DataRecordset object is the name that you passed as the Name parameter to the DataRecordsets.Add, DataRecordsets.AddFromConnectionFile, or DataRecordsets.AddFromXML method when you first created the data recordset; or the name that you subsequently assigned by setting this property. If you do not assign a name when you create a data recordset, Microsoft® Office Visio® assigns a default name, such asSheet1, which would be the assigned name if you imported data from a Microsoft Office Excel® workbook.

If you specify (in the AddOptions parameter of one of the Add methods) that the External Data window be displayed in the Visio user interface, the display name appears on the tab of the External Data window that corresponds to the data recordset.

The Name property value must be unique within a particular document—you cannot assign the same display name to more than one data recordset. If you attempt to assign the Name property value of an existing data recordset to the another data recordset in the same document, the assignment fails. If you add a new data recordset to a document by using the Add method, and if you pass the Add method the name of an existing data recordset as a display name, Visio appends a dash and a numeral (-1, for example) to the name to make it unique within the context of the document.

However, if you delete a data recordset, you can reuse the display name of the deleted data recordset for another data recordset in the same document. This is in contrast to the case with the DataRecordset.ID property value. A particular ID is unique for the life of the document and you cannot reuse it, even if you delete the data recordset to which it was assigned.

See Also