Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQLSERVER Problem
Message
From
22/08/2016 03:28:52
 
 
To
22/08/2016 02:21:09
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows 7
Network:
Windows XP
Database:
MS SQL Server
Application:
Desktop
Miscellaneous
Thread ID:
01639729
Message ID:
01639732
Views:
104
This message has been marked as the solution to the initial question of the thread.
>Sir, I have these codes
>
>
>cmd="select MAX(vou_no)as max_sno from arrival"
>if sqlexec(con,cmd,'table1')<0
>	aerror(laerror)
>	messagebox(laerror[1,2])
>	return.f.
>else
>	select table1
>	thisform.text1.value=nvl(max_sno,0)+1
>endif
>
>
>These code work fine on every event but not on INIT of Form.
>
>When I use above code on INIT of form then I have to face this error message
>
>Connection #1 is busy.

The Init() of controls within the form may be running before the Form.Init(). If any of those run SQLEXEC() commands or use remote views, they may still be executing when the Form.Init() tries to run its code, giving you the error.

One thing to bear in mind is with remote views - they have a default FetchSize of 100, so if a view will return more than 100 rows then it will pause. If you try to do anything else on that same connection you get the error you're seeing. In that particular case the solution is to use DBSETPROP() to set the view's FetchSize property to -1 (fetch all rows).
Regards. Al

"Violence is the last refuge of the incompetent." -- Isaac Asimov
"Never let your sense of morals prevent you from doing what is right." -- Isaac Asimov

Neither a despot, nor a doormat, be

Every app wants to be a database app when it grows up
Previous
Reply
Map
View

Click here to load this message in the networking platform