.

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: ODBCQuery class
The following agent creates a query that retrieves all the rows in the STUDENTS table of the ATDB data source.

Uselsx "*LSXODBC"

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"
 result.Execute
 msg = "Student names:" & Chr(10)
 If result.IsResultSetAvailable Then
   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"
   result.Close(DB_CLOSE)
 Else
   Messagebox "Cannot get result set for STUDENTS"
   Exit Sub
 End If
 con.Disconnect
End Sub

See Also