Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Error connecting to Access DB
Message
From
20/03/2007 14:18:38
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
20/03/2007 14:06:35
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Jet/Access Engine
Miscellaneous
Thread ID:
01206173
Message ID:
01206175
Views:
20
>I wrote a VFP report program that gets some data from an ACCESS database. It works, however occasionally they get the error "Cannot connect to AccessDB Connectivity error:[Microsoft][ODBC Microsoft Access Driver] Too many client tasks."
>
>Does anyone have an idea why I'm getting this error, and how to fix it?
>
>Here is how I'm connecting and returning the information (don't let the field names scare you, it is from a german company).
>
>
 		lcOBDCh =SQLSTRINGCONNECT('DBQ=\\S2\Database\MDB\baback2004.mdb;'+'PWD=;Driver={Microsoft Access Driver (*.mdb)}')
>
>		IF lcOBDCh < 1
>		   AERROR(laError)
>		   MessageBox([Cannot connect to AccessDB ]+laError[1,2])
>		   RETURN .f.
>		ENDIF
>		
>		lcsql = [SELECT T_KUNDENAUFTRAGUNDDETAIL.KA_PASS1X AS X1, T_KUNDENAUFTRAGUNDDETAIL.KA_PASS2X AS X2, ] + ;
>				[T_KUNDENAUFTRAGUNDDETAIL.KA_PASS1Y AS Y1, T_KUNDENAUFTRAGUNDDETAIL.KA_PASS2Y AS Y2, ] + ;
>				[T_AUFTRAGBELICHTERDATENUNDZUSATZ.BAD_DEHNUNG_X AS BADX, T_AUFTRAGBELICHTERDATENUNDZUSATZ.BAD_DEHNUNG_y AS BADY ] + ;
>				[FROM T_KUNDENAUFTRAGUNDDETAIL ] + ;
>				[INNER JOIN T_AUFTRAGBELICHTERDATENUNDZUSATZ ON T_AUFTRAGBELICHTERDATENUNDZUSATZ.BAD_ID = T_KUNDENAUFTRAGUNDDETAIL.KAK_ID ] + ;
>				[WHERE T_KUNDENAUFTRAGUNDDETAIL.KAK_AUFTRAGNR = '] + kbwo.fpartno + [' ]
>
>		IF SQLEXEC(lcOBDCh, lcsql , "cad1") < 1
>		   AERROR(laError)
>		   MessageBox([Cannot get data from MyAccessTable ]+laError[1,2])
>		   SQLDISCONNECT(lcOBDCh)
>		   RETURN .f.
>		ENDIF
>
>
>Let me know if you have any ideas!
>
>Thanks!

If they haven't increased the connection limit then it was 10 sometime. It's saying its connection limit has been reached. You may wait and retyr to get a connection.

It'd greatly help if you disconnect when done (you're not disconnecting in this piece of code -unless there is an error).
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Reply
Map
View

Click here to load this message in the networking platform