How to connect SQL database to Lotus Domino Designer?

I am creating a Lotus Notes application that must have dynamic combo fields. The choice for combo lists must be obtained by selecting from an SQL database.

I am new to Lotus Notes / Domino, I would really like to know how to connect my SQL database for use in the domino designer. Thanks.

Edit: this is a client, not a web

Sub Initialize On Error GoTo e Dim pw As String,user As String,odbc As String Dim i As Integer Dim conn As ODBCConnection,query As ODBCQuery,rs As ODBCResultSet Dim db As NotesDatabase Dim session As NotesSession Dim view As NotesView Dim doc As NotesDocument Dim newDoc As NotesDocument Set session = New NotesSession Set db = session.CurrentDatabase Set view = db.GetView("Reports") Set doc = view.GetFirstDocument Set conn = New ODBCConnection Set query = New ODBCQuery Set rs = New ODBCResultSet Set query.Connection = conn Set rs.Query = query odbc = "server" user = "user" pw = "pass" Call conn.ConnectTo( odbc , user , pw ) i = 0 query.SQL = "SELECT * FROM table" rs.Execute rs.FirstRow Do While Not rs.IsEndOfData i = i + 1 rs.NextRow Loop conn.Disconnect Exit Sub e : MessageBox "Error " & Err & " line " & Erl & ": " & _ Error Exit Sub End Sub 
+4
source share
5 answers

Questions are tagged with Lotusscript, so I assume this is due to Lotusscript (not XPages).

See the ODBCConnection, ODBCQuery, and ODBCResultSet Lotusscript classes in the Domino Designer help database.

+4
source

If you cannot use any XPages components, you can try the ODBC @DBLookup option in the "Use Formula to Select" your summary.

+4
source

The code added to the question will cause an infinite loop due to while / wend

Depending on how often the dropdown options change, you can also create a scheduled agent that connects to the SQL server. I do this a lot for some of my internal applications, as it reduces unnecessary traffic to the SQL server if the return values ​​always match.

The planned agent will need to use the LSXLC extensions by adding UseLSX "*lsxlc" to the Lotusscript agent settings section.

LSXLC has many options that go beyond the scope of this question, so I would recommend looking at the Domino Designer help files and finding lsxlc. There are many examples in the help files.

+2
source

Take a look at extlib on OpenNTF. It has an XPages component that allows you to connect to SQL calls.

http://extlib.openntf.org

+1
source

if you use the xpages application, you can use either a managed bean or a static java method to get the required data and bind it to the selection values ​​of the combobox control.

+1
source

Source: https://habr.com/ru/post/1393989/


All Articles