By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
431,745 Members | 1,873 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 431,745 IT Pros & Developers. It's quick & easy.

open separate recordsets or just filter?

P: n/a
The answer to this one is probably "test it yourself and find out!",
but I'll ask anyway. Pursuant to my previous question - sending
separate recordsets to Word using the CreateTableFromRecordset code
from ADH2000...

I will be opening like 8 recordsets {one for each building, and there
are 8). Would I be better off or is there anything to be gained by
opening one recordset of the query with _all_ the records in it,
filtering that, and sending the result to the function?

My guess is probably not.

I'm doing two buildings per page, so my guess is to do something like
set the fIncludeFieldNames argument to True for the odd numbered calls
and False for the even ones...

If I can't do this with ADO, could I just change the line:

varData = rstAny.GetString()

to return a tab-delimited array in DAO and pass that to Word? (Sounds
like I might have found an instance when I really would like to use
ADO... so far hasn't really happened...)

Thanks for reading this far...
Any pointers would be great!
Thanks,
Pieter
Nov 13 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
To anwer a question you didn't ask, do it the way that's easiest to code
first, then worry about optimization if there is a speed problem.

To answer what you did ask...

Actually, it does depend a lot on context. In most cases you're likely to run
into these days, though, your best bet is to do one query that gets all the
rows your process will use, then filter to get the ones you want, or just rely
on the sort order used in the original query to keep the related groups of
records together.

About the only time I would recommend doing multiple, separate queries for a
single process is when the data resides on a database server, and the size of
the recordsets is very large (say, 50MB or more).

On 19 Sep 2004 19:30:17 -0700, pi********@hotmail.com (Pieter Linden) wrote:
The answer to this one is probably "test it yourself and find out!",
but I'll ask anyway. Pursuant to my previous question - sending
separate recordsets to Word using the CreateTableFromRecordset code
from ADH2000...

I will be opening like 8 recordsets {one for each building, and there
are 8). Would I be better off or is there anything to be gained by
opening one recordset of the query with _all_ the records in it,
filtering that, and sending the result to the function?

My guess is probably not.

I'm doing two buildings per page, so my guess is to do something like
set the fIncludeFieldNames argument to True for the odd numbered calls
and False for the even ones...

If I can't do this with ADO, could I just change the line:

varData = rstAny.GetString()

to return a tab-delimited array in DAO and pass that to Word? (Sounds
like I might have found an instance when I really would like to use
ADO... so far hasn't really happened...)

Thanks for reading this far...
Any pointers would be great!
Thanks,
Pieter


Nov 13 '05 #2

P: n/a
Steve Jorgensen <no****@nospam.nospam> wrote in message news:<u7********************************@4ax.com>. ..
To anwer a question you didn't ask, do it the way that's easiest to code
first, then worry about optimization if there is a speed problem.

To answer what you did ask...

Actually, it does depend a lot on context. In most cases you're likely to run
into these days, though, your best bet is to do one query that gets all the
rows your process will use, then filter to get the ones you want, or just rely
on the sort order used in the original query to keep the related groups of
records together.

About the only time I would recommend doing multiple, separate queries for a
single process is when the data resides on a database server, and the size of
the recordsets is very large (say, 50MB or more).

On 19 Sep 2004 19:30:17 -0700, pi********@hotmail.com (Pieter Linden) wrote:
The answer to this one is probably "test it yourself and find out!",
but I'll ask anyway. Pursuant to my previous question - sending
separate recordsets to Word using the CreateTableFromRecordset code
from ADH2000...

I will be opening like 8 recordsets {one for each building, and there
are 8). Would I be better off or is there anything to be gained by
opening one recordset of the query with _all_ the records in it,
filtering that, and sending the result to the function?

My guess is probably not.

I'm doing two buildings per page, so my guess is to do something like
set the fIncludeFieldNames argument to True for the odd numbered calls
and False for the even ones...

If I can't do this with ADO, could I just change the line:

varData = rstAny.GetString()

to return a tab-delimited array in DAO and pass that to Word? (Sounds
like I might have found an instance when I really would like to use
ADO... so far hasn't really happened...)

Thanks for reading this far...
Any pointers would be great!
Thanks,
Pieter


Thanks, Steve. No, the recordsets are tiny - absolute maximum 150
records. My real problem is going to be moving the data to Word a bit
at a time. The basic format is something like (2 buildings per page).

Building Apt Size Apt Resident Annual Salary Rent
A 2 Efficiency Jones $25,000 $565
A 12 1 Bedroom Smith $28,000 $675

B 1 Efficiency King $25,000 $565

<page break>
Building Apt Size Apt Resident Annual Salary Rent
C 2 Efficiency Jones $25,000 $565
C 12 1 Bedroom Smith $28,000 $675

D 1 Efficiency King $25,000 $565

Guess I'll see if I can't write Ken's code in DAO...

Pieter
Nov 13 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.