Deleted recordd do not updated to the DB when reconnecting and doing updatebatch 
Author Message
 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 ?



Thu, 22 May 2003 03:00:00 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. Doing Update/Delete Queries

2. not to auto update while doing addnew

3. DoEvents when doing UpdateBatch

4. Checking if a delete will succeed (without doing the delete)

5. ADO thinks DBMS is done, but DBMS ain't done

6. rs deletes record while doing insert?

7. Scanning records and doing updates

8. doing updating from grid to sql server with stored procedure sql 2000

9. Update Problem, What am I doing wrong?

10. Error doing update with VB 3.0 and SQL Server 6.5

11. Help, Performance problems doing mass updates

12. Problem, updating the reports, done in crystal

 

 
Powered by phpBB® Forum Software