Share via

DataConnection.FileName Property

Visio Automation Reference

Gets the name of the Office Data Connection (ODC) file that contains the connection string and query command string for the data connection. Read-only.

ms428313.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



expression   An expression that returns a DataConnection object.

Return Value


An ODC file contains a connection string that specifies how to connect to an OLEDB or ODBC data source and a query command string that specifies how to extract the desired data from the data source. An ODC file uses HTML and XML to store connection and query information. You can view or edit the contents of the file in any text editor. ODC files have the .odc file name extension.

When you use the DataRecordsets.AddFromConnectionFile to create a new data recordset, you pass the method a string pointing to an ODC file as the FileName parameter. That string then becomes the value of the FileName property for the DataConnection associated with the resulting data recordset. If the DataConnection object is not associated with an ODC file, the FileName property returns the name and full path of the data-source file passed to the DataRecordsets.Add method as the value of the "Data Source" attribute of the ConnectionString parameter when the data recordset was created.

You can use the Data Connection Wizard in Microsoft Office Access or Microsoft Office Excel to create an ODC file that will connect to and retrieve the data you want.

See Also