Results 1 to 3 of 3
  1. #1
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Sint Niklaas, Belgium
    Posts
    2,778
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Get UNC Name for Pictures (A2K/SR1)

    Francois

  2. #2
    Star Lounger
    Join Date
    Jan 2001
    Location
    Littleton, Colorado, USA
    Posts
    73
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Get UNC Name for Pictures (A2K/SR1)

    <font color=blue>Edited by WendellB to activate link to Post 296892 - see <!help=19>Help 19<!/help>. </font color=blue>

    Hello, All, and please pardon me if this has already been covered and I just can't fathom it from the code I've seen.

    I've set up a data base to record and document issues found. I've given the user the option of storing a photo and storing the path in the database. I've used the code in <post#=296892>post 296892</post#> with great success, but now I'm running into a snag. The problem is that the function returns the file name of the photo as it appears on the system of whoever inserted the picture. If one uses a network drive (we are), the code returns that path (i.e., "P:PathnamePhoto.JPG"). Unfortunately, although we're all connected to this public drive, my "P:" drive might be someone else's "Q:" drive. How might I use the code above to return the UNC name (i.e., "UNCPathnamePhoto.JPG") and avoid this sticky problem?

    Thanks in advance.

  3. #3
    Star Lounger
    Join Date
    Jan 2001
    Location
    Littleton, Colorado, USA
    Posts
    73
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Get UNC Name for Pictures (A2K/SR1)

    Edited by HansV to move very long piece of code (over 6KB) to attachment.

    Thanks for the referral, Francois. To try to give back a little of what I've gained from this site, here's my solution combining the code from Microsoft, and the post from the Lounge about getting files from an the open dialog.

    Using these functions together, a user can select a picture from their local drive or a networked drive. If they select a local drive, the function displays an information box letting them know others won't be able to see the file and save the path in the database. If the user selects a file from a netword drive, the functions strip the local mapping from the file and add the UNC path name to be stored. This allows anyone on the netwrok to see the file, regardless of the local mapping.

    I had hoped the OpenFileDialog function would return the UNC path (that seems intuitive), but this works as a workaround.

    Thanks again to the Lounge in general (and Francois in particular for reminding me Microsoft is still a good resource for information)!

Posting Permissions

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