Table of contents
Collapse the table of content
Expand the table of content

DataConnection.FileName Property (Visio)

office 365 dev account|Last Updated: 6/12/2017
1 Contributor

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.

Note This Visio object or member is available only to licensed users of Visio Professional 2013.


expression . FileName

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 Access or Microsoft Excel to create an ODC file that will connect to and retrieve the data you want.

© 2018 Microsoft