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 Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Query to get a record set

Status
Not open for further replies.

chuito7

Technical User
Jan 5, 2005
26
US
Hi:

First Time here...

I have a table that has 334040 records. I need to populate Excel sheets that only has capacity to aprox. 65,000.

How can I make a query to create a new table for each 60,000 records.

I will appreciate all the help that you can give me!!!


Jesus M. Cruz Narvaez
 
I haven't really found any "real good" approaches to this, but here's two possible things to try:

Here's something I wrote some time ago, thread705-700734, that might be a start.

Also, you could just open a recordset, then use the .CopyFromRecordset method of the Excel .Range object, and use the MaxRows arguement.

[tt]ws.cells(1,1).copyfromrecordset rs, 60000[/tt]

This requires you've selected a current record (starting record), for instance with

[tt]rs.absoluteposition = 0 ' then 65000, ...[/tt]

But after the usage, the recordsets .eof property i true, which means you'll have to reopen the recordset for each copy...

Roy-Vidar
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top