LOTUS CONNECTORS
Uselsx "*LSXODBC" %INCLUDE "lsconst.lss" Dim con As ODBCConnection Dim qry As ODBCQuery Dim result As ODBCResultSet Sub Postopen(Source As Notesuidocument) Set con = New ODBCConnection Set qry = New ODBCQuery Set result = New ODBCResultSet Set qry.Connection = con Set result.Query = qry con.ConnectTo("ATDB") qry.SQL = "SELECT * FROM STUDENTS ORDER BY LASTNAME" result.Execute ... End Sub Sub Click(Source As Button) Dim cacheLimit As String Select Case result.CacheLimit Case DB_ALL : cacheLimit = "DB_CALL" Case DB_NONE : cacheLimit = "DB_NONE" Case Else : cacheLimit = Cstr(result.CacheLimit) End Select If Messagebox("Current settings" & Chr(10) & Chr(10) _ & "Cache limit: " & cacheLimit & Chr(10) _ & "Fetch batch size: " & Cstr(result.FetchBatchSize), _ MB_YESNO, "Do you want change?") = IDYES Then cLimit = Inputbox _ ("Enter 0 for DB_NONE or size of cache", _ "Cache limit?") If cLimit = 0 Then result.cacheLimit = DB_NONE Elseif cLimit > 0 Then result.cacheLimit = cLimit Else Messagebox _ "Cache limit must be 0 or positive integer" Exit Sub End If fbSize = Inputbox _ ("Enter fetch batch size", "Fetch batch size") If fbSize < 1 Then Messagebox _ "Fetch batch size must be positive and not zero" result.FetchBatchSize = 1 Elseif cLimit <> 0 And fbSize > cLimit Then result.FetchBatchSize = cLimit Messagebox _ "Fetch batch size cannot exceed cache limit" Else result.FetchBatchSize = fbSize End If Select Case result.CacheLimit Case DB_ALL : cacheLimit = "DB_ALL" Case DB_NONE : cacheLimit = "DB_NONE" Case Else : cacheLimit = Cstr(result.CacheLimit) End Select Messagebox "New settings" & Chr(10) & Chr(10) _ & "Cache limit: " & cacheLimit & Chr(10) _ & "Fetch batch size: " & _ Cstr(result.FetchBatchSize), "New settings" End If End Sub Sub Queryclose(Source As Notesuidocument, Continue As Variant) result.Close(DB_CLOSE) con.Disconnect End Sub
See Also