In the VB help I can read, that the command ExecuteNonQuery returns the number of affected rows. I tried it, but I always get a -1. Have some of you experiences with this? Here is my code:

Public Function DokumentLoeschen() As Boolean

Dim blnOK As Boolean = True
Dim objDBCommand As New OleDb.OleDbCommand()
Dim objDBParam As OleDb.OleDbParameter
Dim anz As Integer

Try
objDBCommand.Connection = objIBS_SQL.OleDbConnection_SYSTEM
objDBCommand.CommandText = objIBS_SQL.qryDeleteA_IBSDOC.CommandText
objIBS_SQL.blnCopyParameter(objIBS_SQL.qryDeleteA_IBSDOC, objDBCommand)

With objDBCommand
If objIBS_SQL.blnOpenConnection(.Connection()) Then
WhereBedingung(objDBCommand)
anz = .ExecuteNonQuery()
MsgBox (anz)
End If
End With
Catch
blnOK = False
MsgBox("clsIBS_DokumentInfo.DokumentLoeschen: " & Err.Description)
Finally
objDBCommand = Nothing
objDBParam = Nothing
End Try

Return blnOK
End Function