CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 9 of 9
  1. #1
    Join Date
    Aug 2000
    Posts
    29

    Too many client tasks

    Hi! I am using ado data controls in my program and the error Microsoft ODBC Driver Too many client tasks appears. This error appears only in the ados. What could be the cause of this error and what can I do to solve this? Thank you and hope that you could help me.


  2. #2
    Join Date
    Jul 2002
    Location
    Philippines
    Posts
    52
    I've encountered the same problem. When I'm about to click to choose the datasource or rowsource properties of a control, the "too many client tasks" pops out. Does anyone know what is the reason behind this?

    Is it because i have too many adodc controls in my project or what?

  3. #3
    Join Date
    Feb 2001
    Location
    Stamford CT USA
    Posts
    2,167
    So how many data controls that you guys have?

    -Cool Bizs

  4. #4
    Join Date
    Jul 2002
    Location
    Philippines
    Posts
    52
    I got about 25 forms, 20 data environment and 20 data report on my project. In each form the maximum number of adodc object is only about 10.

    So had i reach the maximum number of controls for the whole project? Or i have too many data environment or data report ?

  5. #5
    Join Date
    Feb 2001
    Location
    Stamford CT USA
    Posts
    2,167
    D*m*! That's a lot of controls man ... Can't imagine how you do even manage such application. Do you really need that many Data Controls set up? There gotta be a better way to optimize this.

    I've never encountered that error before but then it is because I've never used that many data controls .... as a matter of fact ... I rarely used data control.

    My advice:
    1. Write a component based application. Meaning? Don't use the DATA CONTROLS. Encapsulate your data access logic into a CLASS and instantiate this class as needed.
    2. If your DB supports stored procedure, then use it. This way you can have 1 connection to the DB and keep requerying the SP to get the data.

    Other than that, hmmm ... I'm still amazed on how you manage that type of application.

    Good Luck,
    -Cool Bizs

  6. #6
    Join Date
    Jul 2002
    Location
    Philippines
    Posts
    52
    Does it matter if i have a lot of controls in a project? I know that there is a maximum number of controls allowable by vb per form, but per project i'm not really sure. As for my application, I really need those controls because its a big project with a lot of reports and forms.

    There is one time i got the source code of an application done in vb from a friend. And when i open it, it has also a lot of controls, objects, data report, etc.. but the "too many client tasks" does not appear when you are choosing the datasource. That confuses me and keeps me thinking where did i go wrong?

    Any ideas or suggestions will be greatly appreciated.

  7. #7
    Join Date
    Feb 2001
    Location
    Stamford CT USA
    Posts
    2,167
    I've not encountered this and therefore my experience on this is a little limited. Hopefully someone out there has been in the same situation and hopefully could give you some pointers.

    -Cool Bizs

  8. #8
    Join Date
    Apr 2002
    Location
    Melbourne, Victoria, Australia
    Posts
    1,792
    Have to admit that I'm with Coolbizs on this one - I try my best not to use data controls and have a data access class contained within a dll....and just re-instance it when required. In my current project, there are 195 instances of where I call the dll - and that's without including every time another class is called where I am instancing the dll.

  9. #9
    Join Date
    Jul 2002
    Location
    Philippines
    Posts
    52
    Being a newbie to vb, its natural for me to use those data controls simply because it is easy Can you guys give me an idea on how to create a class and instantiate it?

    For example in my application, i have a lot of data combo which is associated with an adodc object. How will I create a class similar to this control wherein i could instantiate everytime i needed it?

    Each data report is associated with a data environment.. Is there any optimize way for me to minimize the use of data environment given i need to create many data reports in my application? Unfortunately, the database i'm using is only MSAccess, it doesn't support stored procedures, too bad i can't use it to minimize the use of ado objects.


    A small project with a class for me to download will help a lot. Thanks in advance.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured