Partager via


OLEDBConnection.Connection Property

Returns or sets a string that contains OLE DB settings that enable Microsoft Excel to connect to an OLE DB data source. Read/write Object.

Namespace:  Microsoft.Office.Interop.Excel
Assembly:  Microsoft.Office.Interop.Excel (in Microsoft.Office.Interop.Excel.dll)

Syntax

'Declaration
Property Connection As Object
    Get
    Set
'Usage
Dim instance As OLEDBConnection
Dim value As Object

value = instance.Connection

instance.Connection = value
Object Connection { get; set; }

Property Value

Type: System.Object
Object

Remarks

Setting the Connection property does not immediately initiate the connection to the data source. You must use the Refresh() method to make the connection and retrieve the data. When using an offline cube file, set the UseLocalConnection property to True and use the LocalConnection property instead of the Connection property.

See Also

Reference

OLEDBConnection Interface

OLEDBConnection Members

Microsoft.Office.Interop.Excel Namespace