LOTUS CONNECTOR


例:Disconnect メソッド
次のボタンは現在のデータソースから接続を解除し、続いてユーザーが指定したデータソースに接続します。

Uselsx "*LSXODBC"

Dim con As ODBCConnection

Sub Postopen(Source As Notesuidocument)
Set con = New ODBCConnection
End Sub

Sub Click(Source As Button)
Dim dataSource As String
If con.IsConnected Then
If Not con.Disconnect Then
Messagebox "Disconnect failed from " _
& con.DataSourceName
End If
End If
dataSource = Inputbox$("Enter name of data source", _
"Data source?")
If Not con.ConnectTo(dataSource) Then
Messagebox "Could not connect to " & dataSource
End If
End Sub

Sub Queryclose(Source As NotesUIDocument, Continue As Variant)
If con.IsConnected Then con.Disconnect
End Sub

関連項目