Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

DataConnection.FileName Property

Office 2007
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

Syntax

expression.FileName

expression   An expression that returns a DataConnection object.

Return Value
String

Remarks

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.




Community Additions

Show:
© 2015 Microsoft