DataRecordset.CommandString Property

Visio Automation Reference

Gets or sets the command string used to query the data source to create a data recordset or refresh an existing one. Read/write.

ms428326.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.CommandString

expression   An expression that returns a DataRecordset object.

Return Value
String

Remarks

The command string of a data recordset specifies the database table or Microsoft Office Excel worksheet and the columns within the table or worksheet that contain the data you want to query. The command string is also passed to the DataRecordset.Refresh method when the data in the data recordset is refreshed.

Setting the CommandString property to a new value has no effect on data already in the data recordset. To update the data in a data recordset using a new CommandString setting, call the Refresh method.

The CommandString property does not apply to data recordsets created by using the AddFromXML method.

The following sample command string directs Visio to retrieve all data from an Excel worksheet named Sheet1: "SELECT * FROM [Sheet1$]".

See Also