Indigo Rose Software

Professional Software Development Tools

 
Results 1 to 8 of 8
  1. #1
    Join Date
    Jul 2004
    Posts
    19

    Intranet shared drive access

    I have an AMS 5.0 application that gets folder file information from our company's intranet shared drive:

    files = File.Find("S:\\SAFETY\\Bulletins", "*.*", false, false, nil);

    This worked fine until I discovered that some of our computers have the shared drive mapped as "E" or "T" or some other letter. I cannot request they all remap their computers to "S" for the shared drive as some are already using "S" for some other purpose. Anyway, we have over a hundred computers at our site and I have no idea how many have or do not have "S" mapped as their shared drive.

    Does anyone know a way I can rewrite the above code to find the SAFETY folder and it's subfolders no matter which drive letter our 'shared' drive is ID'd to?

    One more piece of information. Our shared drive, while using MS explorer, will always be indentified by something like: lnlcc20$ on 'usldcvs(S. Of course you wold replace the 'S' with 'E' or 'T' or whatever the individual's mapped drive letter would be. Thanks for any help.

  2. #2
    Join Date
    Jul 2002
    Location
    USA
    Posts
    3,959
    You could use UNC

    \\ComputerName\\ShareName

    For instance, if the computer name was: Computer1
    and the folder was shared as: Safety

    You could do this:

    files = File.Find("\\\\Computer1\\SAFETY\\Bulletins", "*.*", false, false, nil);

  3. #3
    SUF6NEWBIE Guest
    Try this (for true mapped Network Drives)

    CODE:

    Get_Drives_T = Drive.Enumerate(); --function to return all network drives

    for drvindex, drives in Get_Drives_T do
    drive_type = Drive.GetType(drives);
    if (drive_type == 4) then --is a network drive
    --the drive letter will be returned as eg: S:\
    --add here file.find and or a folder.find actions
    --to locate your target id folder\files and you should be all set
    --when located add an if statement to break out of loop.
    if .... then
    break;
    end
    end
    end

    end --end of function

    hope this helps a little
    (having trouble getting the code to show a better layout..sorry)
    Last edited by SUF6NEWBIE; 10-12-2004 at 02:51 PM.

  4. #4
    Join Date
    Jul 2002
    Location
    USA
    Posts
    3,959
    SUF6NEWBIE,

    You can use
    (code)

    Your Code block here

    (/code)


    Substitute square bracket [ ] for the parenthesis ( )



    Quote Originally Posted by SUF6NEWBIE
    Try this (for true mapped Network Drives)

    CODE:

    Get_Drives_T = Drive.Enumerate(); --function to return all network drives

    for drvindex, drives in Get_Drives_T do
    drive_type = Drive.GetType(drives);
    if (drive_type == 4) then --is a network drive
    --the drive letter will be returned as eg: S:\
    --add here file.find and or a folder.find actions
    --to locate your target id folder\files and you should be all set
    --when located add an if statement to break out of loop.
    if .... then
    break;
    end
    end
    end

    end --end of function

    hope this helps a little
    (having trouble getting the code to show a better layout..sorry)

  5. #5
    SUF6NEWBIE Guest
    neat trick WORM...tks --wierd the correct layout would not
    transfer to 'forum display' ....some 'tab' issues at my end.

  6. #6
    Join Date
    Jul 2004
    Posts
    19

    Thanks for your help

    Worn's code worked fine. All I had to do was change:

    files = File.Find("\\\\Computer1\\SAFETY\\Bulletins", "*.*", false, false, nil);

    to:

    files = File.Find("\\\\usldcvs1fsh02\\lnlccf20$\\SAFETY\\B ulletins", "*.*", false, false, nil);

    Thanks for the help.

    Oh, one last question. Why the \\\\ instead of just \\ ???

    Thanks

  7. #7
    Join Date
    Jul 2002
    Location
    USA
    Posts
    3,959
    The first backslash is an escape character to the scripting engine. When it encounters a backslash, it interprets the next character (i.e. \t is equal to tab, \n is a newline). So to have a backslash within your string, you need to double them up because the first one is the escape character, the second one is the actual character. So, to show two backslashes, you must use 4.

    or something like that

  8. #8
    Join Date
    Jul 2004
    Posts
    19

    Thanks Worm

    Worm, thanks again.

Similar Threads

  1. INFO: Microsoft Data Access Components 2.8 Runtime Notes
    By Desmond in forum Setup Factory 6.0 Knowledge Base
    Replies: 0
    Last Post: 11-28-2003, 08:20 AM
  2. Determining the Drive Letter of the Primary Hard Drive
    By Desmond in forum AutoPlay Media Studio 5.0 Examples
    Replies: 0
    Last Post: 10-03-2003, 09:43 AM
  3. access 2000 run time
    By jennersc in forum AutoPlay Media Studio 4.0
    Replies: 0
    Last Post: 07-31-2003, 12:09 PM
  4. INFO: Installing the Microsoft Access Runtime Engine
    By Support in forum Setup Factory 6.0 Knowledge Base
    Replies: 0
    Last Post: 10-11-2002, 01:01 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts