PdcDBQuery.RecordCount: Difference between revisions

From External Bemet Wiki
Jump to navigation Jump to search
No edit summary
MKob (talk | contribs)
dim intCnt is absolutely useless for this function
 
(One intermediate revision by the same user not shown)
Line 14: Line 14:
Sub sExecuteQuery
Sub sExecuteQuery
dim objQuery
dim objQuery
dim intCnt


   set objQuery = pdc.Database.OpenQuery(pdcConData)
   set objQuery = pdc.Database.OpenQuery(pdcConData)
Line 22: Line 21:
     msgbox objQuery.RecordCount
     msgbox objQuery.RecordCount
   else
   else
     msgbox "Error:" & vbCrLf & pdc.LastError & vbCrLf & vbCrLf & "SQL:" & vbCrLf & qryCustomer.SQL
     msgbox "Error:" & vbCrLf & pdc.LastError & vbCrLf & vbCrLf & "SQL:" & vbCrLf & objQuery.SQL
   end if
   end if
End Sub
End Sub

Latest revision as of 08:43, 24 May 2022

Declaration

RecordCount as VT_INT

Description

Returns the record count of the query

Notes

This method returns the total count of records in the created query.

Code example

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

Sub sExecuteQuery
dim objQuery

  set objQuery = pdc.Database.OpenQuery(pdcConData)
  objQuery.SQL = "SELECT * FROM LK_KLANT"

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

Availability

Available since September 2008 (from version 3.8)