Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Too many client tasks in Excel Query

Status
Not open for further replies.

flaviooooo

Programmer
Joined
Feb 24, 2003
Messages
496
Location
FR
Hi, i have a excel (97) sheet which contains a lot of queries. The queries are based on a dBase file I defined in the ODBC. Everything worked fine, but after I added 2 more queries, i get the following errors when i try to refresh all data:
[Microsoft][ODBC dBase Driver] Too many client tasks
[Microsoft][ODBC dBase Driver] Driver's SQLSetConnectAttr failed

I realize this is because there are too many queries at the same time, but i need them all... isn't there a way to make this work with one push on the Refresh all- button??

Thanks in advance
 
If you know where your data ranges are, hold a list of the top left cell in each range in an arrya and loop thru it like this:

dim qArr as variant
qArr = array("A1","D14","F23","Z46")
for i = 0 to ubound(qArr)
Range(qArr(i)).Select
Selection.QueryTable.Refresh BackgroundQuery:=true
next i

you may need to put a wait statement in to make sure excel doesn't process 2 queries at once Rgds
Geoff
"Some cause happiness wherever they go; others whenever they go."
-Oscar Wilde
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top