PdcDBQuery.AffectedRows

From External Bemet Wiki
Jump to navigation Jump to search

Declaration

AffectedRows as integer

Description

Returns the number of records that are affected by the query

Notes

This method returns the number of records that are affected by the query .

Code example

This code example executes a SQL statement and returns the AffectRows.

Sub sExecuteQuery
dim objQuery
dim intCnt

  set objQuery = pdc.Database.OpenQuery(pdcConData)
  objQuery.SQL = "UPDATE LK_KLANT SET KL_USER1 = 'update' WHERE KL_PLAATS = 'Veenendaal'"

  if objQuery.Execute then
    msgbox objQuery.AffectedRows
  else
    msgbox "Error:" & vbCrLf & pdc.LastError & vbCrLf & vbCrLf & "SQL:" & vbCrLf & objQuery.SQL
  end if
End Sub

Availability

Available since September 2017(from version 5.3)