Hi,
I need to access three tables to produce a report in VB but its dog slow. Firstly I get a list of customers from one table then I need to look through two more tables to pick out certain data from any record with a matching Customer ID.
Basically my program runs a Select * for the three tables ordered by customer ID and placed into recordsets. Next I step through the customer table, take the ID and then scan each of the other tables to find the records related to that customer. It works fine just, like I said, really slow.
I’ve tried running queries to scan the two data tables from the database using the ID in a where clause but that make no difference. I thought if I got all the tables in RAM it would be quicker by using a loop then once I found the first record belonging to that customer I could take each subsequent record until the ID changed, as all the queries are ordered that way. It made a little difference but not as much as I’d hoped.
Does anyone know of any optimization or other method I could use to speed it up. I don't think its VBs fault as all it's really doing is sending the SQL and writing the output to a file.
Cheers in advance,
Kevin
I need to access three tables to produce a report in VB but its dog slow. Firstly I get a list of customers from one table then I need to look through two more tables to pick out certain data from any record with a matching Customer ID.
Basically my program runs a Select * for the three tables ordered by customer ID and placed into recordsets. Next I step through the customer table, take the ID and then scan each of the other tables to find the records related to that customer. It works fine just, like I said, really slow.
I’ve tried running queries to scan the two data tables from the database using the ID in a where clause but that make no difference. I thought if I got all the tables in RAM it would be quicker by using a loop then once I found the first record belonging to that customer I could take each subsequent record until the ID changed, as all the queries are ordered that way. It made a little difference but not as much as I’d hoped.
Does anyone know of any optimization or other method I could use to speed it up. I don't think its VBs fault as all it's really doing is sending the SQL and writing the output to a file.
Cheers in advance,
Kevin