Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Multiple Disconnected Recordsets Question 1

Status
Not open for further replies.

TheVampire

Programmer
May 1, 2002
828
US
I have a disconnected recordset that I have created and appended fields to it, and filled it with data ( about 200,000 records ).

If I create a second disconnected recordset, can I select certain records from the first one by using SQL commands ( i.e. SELECT * from 'FirstRecordset' WHERE 'Status' = "OFFLINE" ) and insert them into the second recordset, or will I have to loop through the first RS to get what I need?

Any examples would be helpful!

Thanks,

Robert
 

You could try exporting the data to a temp file using the rs.Save method, or just using GetString and using file I/O methods (probably faster when reading again), and then read it with a second recordset.
 
Sorry, I guess it was quitting time and I read too fast.

The Save method for this would be useless.
I think you are talking about a "fabricated" recordset, and not a disconnected recordset (which I consider to be a recordset which got it's data from a database, but is no longer connected to it).

You can use the filter method as mentioned, but using a recordset clone:

Set rsClone = rsMain.Clone
rsClone.Filter ="..."

You could also save the recordset to a text file, as mentioned before, and then open a new rcordset (not a fabricated one) using JET ISAM Text, or the ISAM TEXT driver, as the connection and use a SELECT sql on the text file.

It may be better to just use a loop. But if it there is more needed, such as GROUPing (and Counts, SUMs, etc.) then it may be easier to use the TEXT driver.
 
CCLINT,

Thanks for the suggestions. I've been in Sydney for the last week and away from the PC.

You are correct, in that I have "fabricated" a recordset and added data to it in my code ( basically by opening a text file and extracting data from each line, and filling in the fields of my recordset ). The amount of data in the file is too much for an array ( out of memory errors ), so I am using a recordset instead.

I'll try the clone method and see if that works for me.

Thanks again,

Robert
 
CCLINT,

Thanks for clobbering me with the "obvious" hammer! [hammer]

The Recordset.filter worked fine.

Robert
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top