>how to test if the network works at any time ?
>how to prevent file access error when the network doesn't work ?
I don't know about API functions.
Two suggested approaches (perhaps you have to combine both):
See if you can access (perhaps create) a specific file.
Intercept errors, using ON ERROR.
HTH, Hilmar.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)