Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to check whether a connection still exists?
Message
 
À
09/01/2004 12:44:50
Information générale
Forum:
Visual FoxPro
Catégorie:
Client/serveur
Divers
Thread ID:
00865357
Message ID:
00865516
Vues:
19
Peter,

You always can check for aa[1,1] or aa[1,2] to get the error number and error description. Like:
if aerror(laError)>0 and laError[1,1]=1466 && VFP error number
?laError[1,2] &&Connection handle is invalid
endif

You could filter out other error as well


>Hi Yuri,
>
>I already have the aerror() information at that point. My coding is something like this:
>
>on error do logerror
>
>procedure logerror
>
>=aerror(laError)
>=sqlexec(gnHandle, "insert into logtable...")
>
>The problem with this coding is that =sqlexec(gnHandle, "insert into logtable...") may generate error if the error which has trigger on error routine is caused by connection problem. So, I want to have a checking before I execute that statement:
>
>on error do logerror
>
>procedure logerror
>
>=aerror(laError)
>if no connection problem */ this is the part I cannot figure how to code this
> =sqlexec(gnHandle, "insert into logtable...") */ sql server table
>else
> insert into logtable */ foxpro table
>endif
>
>
>Thank you for your help,
>
>Peter
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform