Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Error 1526
Message
 
À
14/09/2009 05:44:32
Hong Yew
People Quest
Malaisie
Information générale
Forum:
Visual FoxPro
Catégorie:
Client/serveur
Titre:
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Desktop
Divers
Thread ID:
01424065
Message ID:
01424116
Vues:
55
>Hi all
>
>I need to trap the error 1526, "Communication Link Failure" in my function call to open a view.
>
>May I know how we can check if the connection to MSSQL still active before we open a view?
>
>Your advice much appreciated.

In the class I use for SQL Server there is code in the Error method that automatically attempts to reconnect, ex:
LPARAMETERS nError, cMethod, nLine

DO CASE
    CASE nError = 1466 AND This.nErrorNum <> 1466
        IF This.Connect(This.cConnectString)
            This.nErrorNum = nError
            RETRY
        ENDIF
ENDCASE
The basic idea is that when a call inside of this class runs into an invalid connection handle error, it attempts to re-connect to the server. If it works, great, if it fails again it stops trying (so it doesn't get locked in a loop).You could probably do something similar for the 1526 error. The only "trick" in making this work would be to make sure that you call this class and let it USE your view for you instead of using it directly.
-Paul

RCS Solutions, Inc.
Blog
Twitter
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform