
Deleted recordd do not updated to the DB when reconnecting and doing updatebatch
I cannot get a disconnected recordset to update deleted records to the DB. I
am using SQL server with SQLOLEDB provider
I create a disconnected recordset with:
Function GetRecordset(strSql)
Set rs = CreateObject("ADODB.Recordset")
rs.LockType = adLockBatchOptimistic
rs.CursorType = adOpenStatic
rs.CursorLocation = adUseClient
rs.Open strSql, strConn
Set rs.ActiveConnection = Nothing
Set GetRecordset = rs
end function
I Update with
Public Sub SaveRecordset(ByVal rs As ADODB.Recordset)
On Error GoTo SaveRecordsetErr
rs.ActiveConnection = strConn
rs.UpdateBatch
Set rs = Nothing
Exit Sub
When I change records in this recordset and want to update it to the
database, It works fine for modified records and inserted records but it
does not work when the recordset has deleted records
Any idea tha can help ?