このメソッドは既存のコネクションのコピーを作成します。コピーにはプロパティ値もすべて含まれます。プロパティはすべてコピーされますが、コネクションの現在の状態および結果セットはコピーされません。
LCConnection
Set newConnection = lcConnection.Copy ()
パラメータ |
説明 |
---|---|
lcConnection |
コピーするコネクションオブジェクト。 |
値 |
説明 |
---|---|
newConnection |
lcConnection オブジェクトのコピー。 |
Option Public
Uselsx "*lsxlc"
Sub Initialize
Dim session As New LCSession
' In an LEI Scripted Agent, use the following syntax instead:
' Dim session As New LCSession ("mySession")
Dim connect1 As New LCConnection ("db2")
Dim connect2 As LCConnection
' set the appropriate properties to connect to DB2
' note the use of dynamic properties to do this
connect1.Database = "Gold"
connect1.Userid = "JDoe"
connect1.Password = "xyzzy"
' now copy the connect
Set connect2 = connect1.Copy
If (connect2.Database = connect1.Database) Then
Print "The copy of connection has the same database as the original."
Else
Print "The copy of connection has a different database from the original."
End If
End Sub
The copy of connection has the same database as the original.