.

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: DeleteRow method
This agent deletes a row from a table.

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"
 result.Execute
 studentID = Inputbox$ _
 ("ID of student to be deleted:", "Delete student")
 If studentID = "" Then
   Messagebox "No student ID entered",, _
   "Bogus student ID"
   Exit Sub
 End If
 If Not result.LocateRow(1, Cint(studentID)) Then
   Messagebox "No such student",, "Bogus student ID"
   Exit Sub
 End If
 For i = 1 To 9 ' Get values for columns 1 - 9
   msg = msg & "  " & result.GetValue(i)
 Next
 If Messagebox _
 ("Do you really want to delete this student?" _
 & Chr(10) & Chr(10) & msg, _
 MB_YESNO + MB_ICONQUESTION, _
 "Delete student") = IDYES Then
   result.DeleteRow("STUDENTS")
 End If
 result.Close(DB_CLOSE)
 con.Disconnect
End Sub

See Also