Thank you for being a valued part of the CNET community. As of December 1, 2020, the forums are in read-only format. In early 2021, CNET Forums will no longer be available. We are grateful for the participation and advice you have provided to one another over the years.

Thanks,

CNET Support

General discussion

DB query becomes very slow

Jan 10, 2005 6:51PM PST

Hi All,
I have a piece of code that query MS Access in a loop. As the loop grows larger, each query becomes slower and slower. I'm not talking about the total time to finish loop, I'm talking about each iteration of the loop becomes slower. CPU is not being taxed. It appears that each query to the db simply takes longer and longer. My guess right now is that I got a memory problem but even when I close connections/resultset, it doesn't help. any ideas?

Discussion is locked

- Collapse -
What code?
Jan 10, 2005 8:19PM PST

You didn't share so your problem remains with you and you to solve.

Bob

- Collapse -
code please
Jun 10, 2005 11:12PM PDT

you say it loops?

- Collapse -
Loops.
Jun 11, 2005 12:31AM PDT

I think you nailed it.

A loop from 1 to 1000 could take 10 times longer than 1 to 100.

Amazing?

Bob