Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How can I continue when the network is down?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Client/serveur
Divers
Thread ID:
00109828
Message ID:
00110415
Vues:
45
I don't know of any way of clearing the work areas. Like an other application running on a LAN when the LAN goes down, your stuck. You usually have to "end task" and reboot the machine once the server is back up.

In the case of a Novell server with Windows95 clients, the client will reconnect to the LAN by itself once it detects the LAN back up (I'm sure there is some sort of time limit, but I do not know what it is). I wouldn't bank on this reconnecting your FoxPro apps though.

As far as detecting the existence of the LAN, you could set up a timer that would check for the existance of a particular file on the LAN (i.e. LOGIN.EXE in the SYS:PUBLIC\ for Novell), or you could just check for the file before writing information back to tables. I would suggest the later. My experience is that timer are resource intensive and really slow down your applications.This could help you out somewhat with detecting the error before you write information back to tables, but you still would not be able to close the tables once the network was down.


>I understand your reply - that's why I hoped to be able to trap the error raised by trying to write to the headers. But I can't.
>
>Either (a) is there a way of clearing work areas 'cold',
>or (b) how can I force the error trap?
>
>John Burton
>
>************
>
>>You can't issue your procedure, because in order to CLOSE DATABASES, Foxpro still needs to write information back to the table headers. If the network is down, then it can not see the table headers to update them.
>
>>>I have vfp tables on a server / another part of a LAN. I can trap file reading errors when the network goes down, but how can I close my orphaned work areas? CLOSE DATABASES ALL seems to bypass my error handlers. Even this does not work:
>>>
>>>PROCEDURE SafelyCloseDatabases
>>>LOCAL oSafe
>>>* issues CLOSE DATABASES ALL and traps any error
>>>oSafe = CREATEOBJECT("DATABASECLOSER")
>>>ENDPROC
>>>
>>>DEFINE CLASS DATABASECLOSER AS CUSTOM
>>>
>>> * object class to trap its own error condition
>>> * (overrides other error methods)
>>>
>>> PROCEDURE Init
>>> CLOSE DATABASES ALL
>>> ENDPROC
>>>
>>> PROCEDURE Error
>>> LPARAMETER nError, cMethod, nLine
>>> SET CONSOLE OFF
>>> SET TALK OFF
>>> WAIT "Closing database ..." WIND NOWA
>>> ENDPROC
>>>
>>>ENDDEFINE
>>>
>>>You would think "DO SafelyCloseDatabases" would handle things well enough, but no luck - an error dialog pops up.
>>>
>>>Any suggestions?
>>>John Burton
I would give my left arm to be ambidextrous!
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform