LCConnection の Copy メソッド

このメソッドは既存のコネクションのコピーを作成します。コピーにはプロパティ値もすべて含まれます。プロパティはすべてコピーされますが、コネクションの現在の状態および結果セットはコピーされません。

定義位置

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.