UseLSX "*lsxODBC"
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
'Lotus Notes > Lotus Designer' 카테고리의 다른 글
Lotus Script 로 Collection 이용하기 (0) | 2013.11.21 |
---|---|
@DbColumn, @DbLookup (0) | 2013.11.21 |
Lotus Script - DB 양식에 쓰기 (0) | 2013.09.27 |
Lotus Script - explode (0) | 2013.09.27 |
Lotus Script 텍스트 파일을 읽어서 처리하는 로직 (0) | 2013.09.26 |