You probably will get some speed out of storing in Application variables, I just am not qualified to answer for maximum size or hard numbers for speed.
As for recordsets:
There are a couple things that will give you a little extra speed:
1) In your SQL statements specify field names in the SELECT, this has two advantages
a) Your onl;y getting back fields your going to use and not wasting communications time with data you won't use
b) If you use * then the database does a pre-query for all the filednames from that table, rebuilds the SQL statement, then executes your (altered) sql statement. Specifying the fields means less work for the db for a one time cost of about a minute of your time
2) Instead of looping through recordsets use the GetRows method to pull that data back into an array. This will give you extremely noticeable results for pages that are just listing out lots of records
3) Instead of using the RecordSet.Open method, use the Connection.Execute method to execute into a recordset. Cuts out a little overhead on forcing the recordset to make the query for you.
4) In multi-table SQL statements use JOIN statements instead of comma delimited lists of tables:
With SELECT statements the db makes a temporary table based on the FROM clause then filters the data according to the WHERE and GROUP BY and then re-orders by the ORDER BY
If you use commas in the WHERE the db first creates a temp table of every combination of records in those tables, then applies the where
If you use JOINs (JOIN, INNER JOIN, etc.) then it makes that first temporary table based on the Join ON conditions
Example:
You have 3 tables
Owner - 10 records
CarType - 5 records
Manufacturer - 2 records
pretend one-to-many between owner-carType and carType-manufacturer. Pretend there is a manufacturer called Ford, there are 2 records in carType that are Fords, and there are 5 people that own those 2 types
SELECT * FROM Owner, CarType, Manufacturer WHERE Manufacturer.Name = 'Ford'
This makes a temporary table of 10 * 5 * 2 records, then loops through the 100 records filtering for Manufacturer.name=ford to get the 5 records that should result
SELECT * FROM ((Owner JOIN CarType ON Owner.carName = CarType.Name) Join Manufacturer ON Manufacturer.Name = CarType.manName) WHERE Manufacturer.Name = "Ford"
This one creates a temp table of only meaningful data, so it will have 20 records. It then loops through those 20 looking for the Ford's
Anyways, hadn't planned on going so long. Think there are probably some threads still hanging around on db efficiency if you search from the search tab above, these were just the major things that came to mind.
-T
01000111 01101111 01110100 00100000 01000011 01101111 01100110 01100110 01100101 01100101 00111111
The never-completed website: