How to retrieve network path from mapped drive path

GaryD
Member Posts: 66
Hello, using the CommonDialog control, I allow a user to select a file. Then I place that path and filename into a field of a table. Once the path is stored in the table, other users should be able to click a button on the form and open the designated file. The problem is that the path may be a mapped drive path and other users would not be able to access the file that way. Is there a way to retrieve the UNC path from the mapped drive path?
Thanks!
Thanks!
0
Comments
-
Even if it is saved on their c drive and it's not shared - I'm never going to be able to get. That's why long ago when we set up the network all the computers have the same mapped network drives (makes life alot easier)
I (Navision Database)
M (Crystal Reports)
P (All Pictures)
S (All Documents)
Z (BackUp Files)
etc...
This way any path from one machine is the same for all.
IMHO
What are you looking for something like %ROOT%0 -
You can also store the file in the db as blob, depending on the size.
Then you don't have to worry where it is stored because it'll will be always at the server.
Also SQL 2K8 has this feature, and it can store files in separate folder on sql so they are not really stored in the db.
I hope Navision implements this feature down the line.0 -
After Saving the Path in an Field, you can get the Shared Name with following Source and save it into an other field. From other clients, you open the file with using Shared Name (UNC)
....
use your code with openDialog
....
now we will get the Shared Namevariables: Name DataType Subtype Length WSHDrive Automation 'Windows Script Host Object Model'.Drive WSHFSO Automation 'Windows Script Host Object Model'.FileSystemObject if isclear(WSHFSO) then create(WSHFSO); WSHDrive := WSHFSO.GetDrive('YOURDRIVELETTER'); //('Z:\') //Convert / add here '\' Rec.FieldShardName := WSHDrive.ShareName(); //(ComputernameOrIP\Folder\folder2\...) .....
now you can open the file using SharedName. (User must have permissions to connect to the Computer / Folder)
RegardsDo you make it right, it works too!0 -
Thanks garak. Just what I needed! And thanks to the other responders. This newbie appreciates it!0
-
PleaseDo you make it right, it works too!0
-
[Topic moved from Navision forum to Navision Tips & Tricks forum]Regards,Alain Krikilion
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions