|
-
Jun 21st, 2002, 01:56 AM
#1
Thread Starter
Lively Member
Rowsaffected and ExecuteNonQuery
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|