DAO Connectionless Recordset?



Creating a connectionless recordset in ADO is simple enough, but how do
you do it in DAO? I want a recordset stored in memory so I can
filter/sort it easily. If I create a table I can make it work, but I
don't want to have to read/write everything from/to disk every time I
need to use the data.

I tried:

Dim r As DAO.Recordset, tdf As DAO.TableDef

Set tdf = CurrentDb.CreateTableDef("tmp", dbHiddenObject)
With tdf.Fields
.Append tdf.CreateField("TypeID", dbLong)
.Append tdf.CreateField("Minor_ID", dbLong)

End With

'ERROR 3420 "Object invalid or no longer set"
Set r = tdf.OpenRecordset

r.AddNew
r.Fields("TypeID") = 1
r.Fields("Minor_ID") = 7
r.Update

r.Close
Set r = Nothing
Set tdf = Nothing

.