Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQLSERVER Problem
Message
De
22/08/2016 03:28:52
 
 
À
22/08/2016 02:21:09
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows 7
Network:
Windows XP
Database:
MS SQL Server
Application:
Desktop
Divers
Thread ID:
01639729
Message ID:
01639732
Vues:
99
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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform