How to "read" a directory

delfoncedelfonce Member Posts: 10
Hello,

In my database (3.70), when the user releases an order, the system writes a file in a specific directory.
But how can I know if the user can connect to this directory ? (because if he can't connect, I want to display him a message and the order won't be released and the file won't be created.)
Thanks
Delphine

Comments

  • FeldballeFeldballe Member Posts: 26
    Hello Delphine.

    You can use 'Microsoft Scripting Runtime'.FileSystemObject to test for user-connection to the specific folder. It's working with both local and shared folders. 'Microsoft Scripting Runtime' should be a standard feature in any Windows installation.

    Regards
  • delfoncedelfonce Member Posts: 10
    OK, I'm going to see.

    Thank you !
  • danlindstromdanlindstrom Member Posts: 130
    The methods f.OPEN and f.CREATE returns FALSE if the file cannot be created.

    IF NOT f.CREATE(...) THEN
    ERROR('Cannot create files to release the order');
    Regards
    Dan Lindström
    NCSD Navision 2.00 since 1999 (Navision Certified Solution Developer)
    MBSP Developer for Microsoft Dynamics NAV 2009
Sign In or Register to comment.