Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Testing connection to SQL Server
Message
De
22/12/2022 10:59:28
 
 
À
22/12/2022 10:49:38
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01685573
Message ID:
01685578
Vues:
47
>>Often times, after the above code, the program fails when attempting to SQL Select some records from the SQL Server.
>>
>>So, I am thinking that the code of testing SQLEXEC() against an empty string, should be changed to testing SQLEXEC() against something in the SQL Server. Because, if the connection to the SQL Server is broken, the SQLEXEC() can still successfully work on an empty string. Right?
>>
>>If the above logic is correct, how do I change the test of SQLEXEC() NOT against an empty string but against something in the SQL Server?
>
>Without going into the issue what does an empty command do, how about just „select @@version“?

You can do this also. BUD: Would yo do this every Time a SQL Fires? I Won't. This will kill your performance dramatically, especially on low bandwidth connections.

Wrap your sqlExec() calls in a function or method
check the returnval sqlExec() and then handle the errors like in the other Thread

Well now you say "Bud sqlExec() is used natively at 1000 times in my code".
Ok. You can easy replace it by
#define sqlExec myNewErrorhandledSQLExec

in your .h File...
Jörg Schneider
Joerg.Schneider@SMARTCRM.de
SMARTCRM CRM powered by MS Visual FoxPro
SMARTCRM GmbH
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform