.

HCLSoftware Business Partner
Domino Consulting Services
CRUCIAL Notes Tools
+1 212-599-2048

Domino Consulting Services
CRUCIAL Notes Tools
Domino administration
Notes development

Facebook Twitter YouTube
Chat now       
.
ProductsDownloadsNewsAbout usContact


Need a Domino Consultant? Call NotesMail +1 212-599-2048 - HCLSoftware Business Partner

LOTUS CONNECTORS


Examples: MaxRows property
This agent limits the result set to what the user specifies, defaulting to the complete result set.

Uselsx "*LSXODBC"
%INCLUDE "lsconst.lss"

Sub Initialize
 Dim con As New ODBCConnection
 Dim qry As New ODBCQuery
 Dim result As New ODBCResultSet
 Dim firstName As String
 Dim lastName As String
 Dim msg As String
 Set qry.Connection = con
 Set result.Query = qry
 con.ConnectTo("ATDB")
 qry.SQL = "SELECT * FROM STUDENTS ORDER BY LASTNAME"
 result.Execute
 If Messagebox("", MB_YESNO, _
 "Do you want the whole result set?") = IDYES Then
   maxRows = 0
 Else
   maxRows = Inputbox("How many rows?", _
   "MaxRows", "50")
   If maxRows = "" Then maxRows = 0
 End If
 result.MaxRows = maxRows
 msg = "Student names:" & Chr(10)
 Do
   result.NextRow
   firstName = result.GetValue("FIRSTNAME", firstName)
   lastName = result.GetValue("LASTNAME", lastName)
   msg = msg & Chr(10) & firstName & " " & lastName
 Loop Until result.IsEndOfData
 Messagebox msg,, "Student Names"
 con.Disconnect
End Sub

See Also