View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Martin Fishlock Martin Fishlock is offline
external usenet poster
 
Posts: 694
Default Slow running SQL via ADO connection in excel

Hi Azza,

It maybe the way the sql is working and the data that is fetched from the
database via the ADO pipe.

Try using queries in access rather than sql in excel. I know that you want
dynamic queries but it will see if the that is the problem.

If it solves it you then know that you need to refine the data extraction
routine.

One way is to create dynamic queries in access from excel run the queries
and then extract the results to excel.

just osme ideas for you to try.

And I would be interested to see other answers.
--
Hope this helps
Martin Fishlock, Bangkok, Thailand
Please do not forget to rate this reply.


"Azza" wrote:

Hi,

I have an interactive report which uses a combination of SQL statements, VB
and other excel functions to return various stats driven by what the user
sets as perameters.
The SQL statements are stored in excel on a worksheet and i have written an
ADO connection module to create a connection to the database and execute the
SQL. The results are then returned into the same excel workbook. The SQL
works and all results are returned however it seems a little slow.

I have tried running the SQL in access itself and the total duration of the
4 queries is approx 1minute but running through excel, the SQL execution time
is 3minutes.

Does anybody have any idea why executing SQL through excel would take almost
triple the time than directly in access?
Please could somebody advise how i can get round this and speed the SQL
execution up?

All help greatly appreciated.