DataRecordset.GetRowData Method
Visio Automation Reference |
Gets the data in all columns in the specified row.
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.GetRowData(DataRowID)
expression An expression that returns a DataRecordset object.
Parameters
Name | Required/Optional | Data Type | Description |
---|---|---|---|
DataRowID | Required | Long | The ID of the row in the data recordset from which you want to retrieve data. |
Return Value
Variant()
Remarks
To get the row IDs of all the rows in the data recordset, use the GetDataRowIDs method. See the example in this topic.
If you pass a row ID of zero for the DataRowID parameter, the GetRowData method returns the names of the columns in the data recordset. If you pass any other valid row ID than zero, the GetRowData method returns values for all the columns in the specified row, in the same order as the column names that the method returns when you pass zero.
Example
This Microsoft Visual Basic for Applications (VBA) macro shows how you can use the GetDataRowIDs and GetRowData methods to return the row ID of each row and then get the data stored in each column in every row of the specified data recordset. The macro gets the count of all data recordsets associated with the current document and gets row data for the one most recently added. It iterates through all the rows in the data recordset and then, for each row, iterates through all the columns in that row. The code displays the information returned in the Immediate window.
Before running this macro, create at least one data recordset in the current document.
Note that the macro passes an empty string to the GetDataRowIDs method to bypass filtering and get all the rows in the recordset. After you run the macro, note that the first set of data shown (corresponding to the first data row) contains the headings for all the data columns in the data recordset.
Visual Basic for Applications |
---|
|
See Also