Re: Clearing a recordset

From: Val Mazur (group51a_at_hotmail.com)
Date: 06/24/04


Date: Wed, 23 Jun 2004 22:01:07 -0400

Hi Alan,

There is no direct way to do this, since Delete method deletes only current
record or group of the records, which belong to the specific group, like
Appended, Conflict records. You have several choices
- To loop and delete all the records one-by-one.
- Initialize recordset variable again ant it will delete all the records.
- Filter recordset using condition, when you will not have any matching
record. In this case you will get empty filtered recordset. Then save this
filtered recordset into ADO Stream. In this case stream will contain empty
recordset. Now load recordset back from the stream and you will get empty
recordset.

-- 
Val Mazur
Microsoft MVP
"Alan Hood" <hood@dial.pipex.com> wrote in message 
news:OVSLHbTWEHA.2176@TK2MSFTNGP11.phx.gbl...
> Can anybody tell me a simple way to clear a recordset of all its records.
>
> I'm sure I could do it with .delete but have been unable to do so
>
> Many Thanks
>
> Alan Hood
>
> --
>
> 


Relevant Pages

  • Re: Using Excel to check Access db for matching record
    ... but, after opening a recordset, you should test to see if it's empty. ... you don't test and an Access table is empty, ... Set DAORS = DAOTBL.OpenRecordset ... Dim CheckRng As Excel.Range ...
    (microsoft.public.access.modulesdaovba)
  • Re: Recordset.sort problem
    ... >I am using a recordset to populate a grid. ... all empty fields are displayed first. ... If recordset is read only, then you should construct you SQL statement ... Than, when you populate the grid, check content for that predetermined word ...
    (microsoft.public.vb.database.ado)
  • Re: after 2 days empty results
    ... I did a tests on sevral servers. ... but after an amount on time I see 'empty results'. ... recordset like this: ...
    (microsoft.public.inetserver.indexserver)
  • Re: Empty "If Me.Recordset Is Nothing Then" clause causes runtime error 3021 (Access 2003)
    ... > It's not used to see if a recordset is empty or not. ... runtime error 3021 it just matters that you test "Me.RecordSet Is Nothing". ... I don't do anything else in Form_Currentin my test database but still get ...
    (microsoft.public.access.formscoding)
  • Re: Empty "If Me.Recordset Is Nothing Then" clause causes runtime error 3021 (Access 2003)
    ... > It's not used to see if a recordset is empty or not. ... runtime error 3021 it just matters that you test "Me.RecordSet Is Nothing". ... I don't do anything else in Form_Currentin my test database but still get ...
    (microsoft.public.access.forms)