ADODB.Connection error '800a0e80'

I'm getting this error running a select stmt that sums thousands of records. I think it may be a timing issue but I'm sure I've run larger queries.

ADODB.Connection error '800a0e80'
Operation has been cancelled by the user.

I can't find info on this error anywhere. Has anyone seen it , or have an idea where to look or how to troubleshoot?

My select is ...
strsql = "SELECT Fund, SUM(Shares) AS TotalShares, SUM(Cost) AS TotalCost
             FROM Transactions
             WHERE PlanMne ='" & Session("PlanMne") & "' "
             GROUP BY Fund
             ORDER BY Fund

I'm using the Advantage database from Extended Systems if that matters.

Thanks
careybAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Guy Hengel [angelIII / a3]Billing EngineerCommented:
what are the data types of the fields Fund, shares and cost?
careybAuthor Commented:
Fund is character, shares & cost are doubles
careybAuthor Commented:
This query, by itself, works ok.  I'm now trying to run it on a plan that has many, many more records than any of the others I've tried, although I don't have an exact count.
OWASP Proactive Controls

Learn the most important control and control categories that every architect and developer should include in their projects.

jrramCommented:
Give your connection a higher command timeout value like:

MyConnection.CommandTimeout = 240
programmer_bmbCommented:
is that sql as u put in prog ?

make it :

strsql =                " SELECT Fund, SUM(Shares) AS TotalShares, SUM(Cost) AS TotalCost " 
strsql &=              " FROM Transactions " 
strsql &=             " WHERE PlanMne ='" & Session("PlanMne") & "' "
strsql &=             " GROUP BY Fund " 
strsql &=             " ORDER BY Fund " 


Thanks
DragonlairdCommented:
Make sure the fields used in the Where clause, Group By clause, Order By clause and Sum'ed values are all indexed.

e.g. Ensure there are indexes on the following fields:
Shares
Cost
PlanMne
Fund

It's often all too easy to forget something as simple as this and can cause unusual results when the query times out.

Also, try running the query in your favourite DB Query Tool to see how long it is likely to take to return a response, this might give you an indication of how long the timeout value should be set for.

On this note, if the query is likely to take quite a while to run, do you really want to run it in as ASP page? Remember, web visitors will not sit and wait for ages until a query runs, especially if they don't know why the response is taking so long...

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
careybAuthor Commented:
jrram,
The default looks like it is set at 240. I doubled it, and the query ran until I got a script timeout. I'll try adjusting the value & see if I can get it.
careybAuthor Commented:
programmer_bmb,
That's correct, I just tried to take out all of the extra stuff to make the question as clear as possible.
careybAuthor Commented:
DragonLaird,
I added the index (wasn't there) and it hasn't yet solved the problem. I'll run it in the analyzer when I get back into the office.
careybAuthor Commented:
good job guys. Thanks for the tip jrram, that is one of the things I have to do.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP

From novice to tech pro — start learning today.