Re: Indicating Deleted Records

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: DNagel (NOTGrandNagel_at_hotmail.com)
Date: 08/03/04


Date: Tue, 03 Aug 2004 09:05:57 -0700

ChrisM wrote:
> Hi,
>
> I have a VB6 form with a ADO Data Control on it.
>
> On the form is a set of textboxes which are databound to fields in the Data.
>
> There is also a Delete button which calls the Delete method on the
> DataControls Recordset.
> Due to the properties of the recordset, deleted records are only marked as
> such until the .UpdateBatch method is called (this is what I want to
> happen).
>
> My question is, as the records still appear to be there until the
> BatchUpdate is called, is there a way of telling/indicating to the user that
> the record is pending deletion?
>
> TIA,
>
> ChrisM.
>

Heres some comments from
http://17.webmasters.com/caspdoc/html/ado_recordset_object_delete_method.htm

according to this The Filter method should permit you to show or hide
the deleted records...

D.

Delete Method Remarks

Using the Delete method marks the current record or a group of records
in a Recordset object for deletion. If the Recordset object doesn't
allow record deletion, an error occurs. If you are in immediate update
mode, deletions occur in the database immediately. Otherwise, the
records are marked for deletion from the cache and the actual deletion
happens when you call the ADO Recordset Object UpdateBatch Method. (Use
the Filter property to view the deleted records.)

Retrieving field values from the deleted record generates an error.
After deleting the current record, the deleted record remains current
until you move to a different record. Once you move away from the
deleted record, it is no longer accessible.

If you nest deletions in a transaction, you can recover deleted records
with the RollbackTrans method. If you are in batch update mode, you can
cancel a pending deletion or group of pending deletions with the ADO
Recordset Object CancelBatch Method.

If the attempt to delete records fails because of a conflict with the
underlying data (for example, a record has already been deleted by
another user), the provider returns warnings to the ADO Errors
Collection, but does not halt program execution. A run-time error occurs
only if there are conflicts on all the requested records.



Relevant Pages

  • Compacting a Random created file
    ... I can get the record marked for deletion OK. ... I have no problem detecting and not copying the ... rid of the darned deleted records when reading into an array and then ... deleted record all the time and would necessitate counting deleted records ...
    (microsoft.public.vb.general.discussion)
  • Re: Homegrown synchronization
    ... with deleted records in a different way. ... table a record was deleted from, the date of deletion and the PK. ... Then you'll join each table to the PK field of the tombstones table, ... the delete flag because you're re-using PKs. ...
    (microsoft.public.access.replication)
  • Re: unable to undo delete on form that uses ADO recordset
    ... I am able to edit existing records, ... Is this just a bug with ADO? ... handle all deletion logic myself, ... Does anyone know how to fix this bug with Access? ...
    (comp.databases.ms-access)
  • Re: Deleted Records and DataAdapter.Fill
    ... If all of the deletion is being done client side, ... > Why DataAdapter.Fill does not refresh the deleted records in the dataset? ... > I have a DataAdapter refering to a table in database. ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: How to exclude pending deleted data from a recordset or command object?
    ... nevermind. ... > If I try to get the max and min values from the tables using an ADO ... > records that are pending deletion. ...
    (microsoft.public.vb.database.ado)