Connections.Add2 方法

定义

向工作簿添加新连接。

public Microsoft.Office.Interop.Excel.WorkbookConnection Add2 (string Name, string Description, object ConnectionString, object CommandText, object lCmdtype, object CreateModelConnection, object ImportRelationships);
Public Function Add2 (Name As String, Description As String, ConnectionString As Object, CommandText As Object, Optional lCmdtype As Object, Optional CreateModelConnection As Object, Optional ImportRelationships As Object) As WorkbookConnection

参数

Name
String

连接的名称。

Description
String

连接的简要说明。

ConnectionString
Object

连接字符串。

CommandText
Object

用于创建连接的命令文本。

lCmdtype
Object

命令类型。

CreateModelConnection
Object

指定是否创建到 PowerPivot 模型的连接。

ImportRelationships
Object

指定是否导入任何现有关系。

返回

适用于