Una famiglia di sistemi di gestione per database relazionali di Microsoft progettati per semplificare l'uso.
ciao Nicola,
ricordi quanto discusso circa le transazioni....?
Nelle action queries puoi anche sfruttare la proprietà recordsAffected senza contare le righe coinvolte nella stessa prima...
prova su una copia back up...! segue :
Option Compare Database
Option Explicit
Sub test()
On Error GoTo errHandler
Dim strSql As String
Dim lngRec As Long
Dim boolT As Boolean
strSql = "delete * from tIban where iban is null"
DBEngine.BeginTrans
With DBEngine(0)(0)
.Execute strSql, &H80
lngRec = .RecordsAffected
End With
If lngRec > 0 Then
If VBA.MsgBox("vuoi eliminare " & lngRec & " dalla tabella tIban ?", vbCritical + vbYesNo, "avviso") = vbYes Then
If VBA.MsgBox("ancora, sei propri sicuro?", vbInformation + vbYesNo, "Attenzione") = vbYes Then
DBEngine.CommitTrans
boolT = True
End If
End If
End If
exitErrHandler:
If Not boolT Then
DBEngine.Rollback
End If
Exit Sub
errHandler:
With Err
MsgBox "ERR#" & .Number _
& vbNewLine & .Description _
, vbOKOnly Or vbCritical
End With
Resume exitErrHandler
End Sub
ciao, Sandro.