Stimmen denn wirklich die Werte für dsnname (als datasource) und user und pwd?
Der Sample Code aus der Designer-Hilfe sieht ziemlich ähnlich aus.
Hier kannst Du die Daten eingeben, ohne jedesmal neu zu kompilieren.
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
Dim userName As String
Dim password As String
dataSource = Inputbox$ _
("Enter name of data source", "Data source?")
userName = Inputbox$ _
("Enter user name, if required", "User name?")
If userName = "" Then
If Not con.ConnectTo(dataSource) Then
Messagebox "Could not connect to " & dataSource
End If
Else
password = Inputbox$("Enter password", "Password?")
If Not con.ConnectTo(dataSource, _
userName, password) Then
Messagebox "Could not connect to " & dataSource
End If
End If
End Sub
Sub Queryclose(Source As NotesUIDocument, Continue As Variant)
con.Disconnect
End Sub
Grüße David