Question Share Name v/s Mapped drive (1 Viewer)

Kobus-Dippenaar

Registered User.
Local time
Today, 10:14
Joined
Oct 10, 2014
Messages
50
Good day to all programmers,


For the first time I do not understand why a mapped drive shows the share name and not the drive letter (example x:)


See attached jpg file.


the mapping should come out as x:\....


Thanking you in advance


Kobus
 

Attachments

  • 0IMG_20180817_135033.jpg
    0IMG_20180817_135033.jpg
    99.1 KB · Views: 109
  • 0IMG_20180817_132257.jpg
    0IMG_20180817_132257.jpg
    88 KB · Views: 102

Frothingslosh

Premier Pale Stale Ale
Local time
Today, 03:14
Joined
Oct 17, 2012
Messages
3,276
Drive letters are technically unique to each PC - there's nothing stopping one network location from being saved as the Q drive on one PC and the T drive on another.

Using the network path instead means that the application can find the table regardless of how the share is saved on the local machine.

In this case, it's Access working as designed.
 

Ranman256

Well-known member
Local time
Today, 03:14
Joined
Apr 9, 2015
Messages
4,337
yes, always use full UNC path: \\server\folder\folder\file.db
never drive letters.
 

Kobus-Dippenaar

Registered User.
Local time
Today, 10:14
Joined
Oct 10, 2014
Messages
50
Thank you for your response, but I need to find a way back to use the mapping drive letter.
The Network Technician argues that the share name will change the moment a new drive is installed replacing the current drive and the share name will differ.


The Data Base has 8000 records linking to 40,000 photos.
So in a table I have 5 fields that links to photos on the disk.
example x:\ODM Photos\20010812005084\20180803\1234.jpg


Hence we would like to stay with the mapping drive letter.


Hope someone can help.


Blessings.


Kobus
 

Frothingslosh

Premier Pale Stale Ale
Local time
Today, 03:14
Joined
Oct 17, 2012
Messages
3,276
The whole point is that the share name does NOT change unless you replace the hosting computer. It's NOT going to change if you change the user's hard drive.

The UNC format is literally \\server\folder\folder....\folder\file and that doesn't change unless you change the server itself. (And doing that will break all the letter mapping anyway, as they are just masks FOR UNC paths.)

In this situation, your network technician is wrong.
 

Gasman

Enthusiastic Amateur
Local time
Today, 08:14
Joined
Sep 21, 2011
Messages
14,267
The share name could well change if they install a new drive, but it is up to them to keep the share name the same, just as they would keep the mapped drive letter the same.

If you think about it, if the share name changes, the drive mapping is not going to work either.?
 

Kobus-Dippenaar

Registered User.
Local time
Today, 10:14
Joined
Oct 10, 2014
Messages
50
Thank you for your comment. I understand, but it would be far easier to do one mapping of the x: drive than to run a fix running through 40,000 records to change the beginning of the link.


Should we change the server drive I would keep my folder names the same and map the drive on the lan laptop without running a fix to change the original link in the table field mentioned earlier on.


so my question is, is there a way to setup Access or the Network to recognize the letter mapping. (It works on other networks) but not on this system the client implemented. And I don't know why?


:banghead:


Thank you for your patience, HELP!


Kobus
 

June7

AWF VIP
Local time
Yesterday, 23:14
Joined
Mar 9, 2014
Messages
5,470
I agree with comments by others. If you use drive letter, every user must have the same letter mapped the same. Changing the server name means remapping every users letter paths or IT sets a redirect link to the new server name (I've been a user through a couple of server name changes and it was basically invisible to us). A single UPDATE query can modify all records using Replace() function.

However, don't really have to save full path in data. It can be supplied in an expression. For example, the ControlSource property of Image control can be:

="x:\folder\folder\" & [fieldname]

or

="\\server\folder\folder\" & [fieldname]

or

=CurrentProject.Path & "\foldername\" & [fieldname]
 
Last edited:

Frothingslosh

Premier Pale Stale Ale
Local time
Today, 03:14
Joined
Oct 17, 2012
Messages
3,276
You got the UNC link because that's how the person setting up the linking did the search for the back end, in all likelihood.

It really is smarter to just use the UNC path because that will stay the same no matter how the desktops are set up.

And updating 8000 records is child's play - it can be done with one query. For example, to replace X: with \\SEAGATE-DP4, you might use this:

Code:
UPDATE 
    TableName
SET 
    Field1 = "\\SEAGATE-DP4" & Right(Field1, Len(Field1)-2)
    , Field2 = "\\SEAGATE-DP4" & Right(Field2, Len(Field2)-2)
    , Field3 = "\\SEAGATE-DP4" & Right(Field3, Len(Field3)-2)
    , Field4 = "\\SEAGATE-DP4" & Right(Field4, Len(Field4)-2)
    , Field5 = "\\SEAGATE-DP4" & Right(Field5, Len(Field5)-2)
(Before you try something like this, TEST IT and back up your data, though!)
 

Gasman

Enthusiastic Amateur
Local time
Today, 08:14
Joined
Sep 21, 2011
Messages
14,267
I have just split a database of mine and split to the L: drive.?
Tables now show L:\ when you hover.
I seem to recall that when you relink I have always taken care to use the UNC path and NOT the drive letter for the very reason that not every drive would be mapped the same.

So just relink to a drive letter and not a UNC path.
I also *thought* that Access always store the drive path to objects in their full form, unless you parsed the path and only stored the static part of the path,?

I would ask what is the path to the photos in the tables?
 

Galaxiom

Super Moderator
Staff member
Local time
Today, 17:14
Joined
Jan 20, 2009
Messages
12,852
Best practice when linking to a file system is to store the most significant parts of the path as a records in a table and reconstitute the whole path from that plus the less significant parts of the path stored in the individual records.

Then when the location of the files changes, everything can be pointed to the new path by changing one record in the back end.
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 02:14
Joined
Feb 28, 2001
Messages
27,172
The Network Technician argues that the share name will change the moment a new drive is installed replacing the current drive and the share name will differ.

Shares can be moved. But more important, if the share is moved but the new meaning is correctly updated and published, YOU WON'T KNOW THE DIFFERENCE if you use the \\server\share\sub-path\file.type mapping, which is UNC style.

If your techie person says you cannot rely on the share name then you need to FIRE that useless S.O.B. before he screws you to tears because he clearly knows NOTHING about proper mutli-machine network management. Share names are what you use to PREVENT disruption by internal resource changes. You update and publish the new name and never know that the drive was just changed from a 256 Gb disk to a 2 TB disk. You just keep on using it but it suddenly seems bigger.

Technically, yes... It is possible and even likely that replacing a drive will cause the physical path to change. But if your tables stored fields based on the drive:\path\name.type info and the drive was changed out, the stored data would have to be changed too, because the drive letter is a LOCAL item.

If you carefully reverse-engineered Windows, or (better still) read a book on Windows Internals, you would find that the drive letter table is a DATA STRUCTURE: a list of POINTERS to devices that can include ANYTHING - technically, including serial ports if you wanted to map it that way (though I wouldn't do that). It is just a text table of 26 slots where you can put 26 "aliases" for the 26 letters. Technically, the letters are the aliases, but you get the idea.

When you use X:, that merely picks up the contents of slot X in the table and appends whatever was to the right of the colon. So... if drive X: is mapped to "\\SEAGATE-DP4\06Quotes" then ELIMINATE THE MIDDLEMAN. Just use "\\SEAGATE-DP4\06Quotes\rest-of-path" directly. HINT: If the drive gets replaced bad enough that the Share info changed, the alias underlying the X: entry is wrong, too!

In fact, I'm going to be brutal about it. What you described is a potentially really bad design choice. You should NEVER EVER use drive-letter mapping for data that references files from inside a database. But now the good news. If you had room for the drive:\path\name.type mapping, you have room for UNC mapping, since they usually take the same amount of space.

We had a situation with the U.S. Navy where I ran an Access database that was potentially used by about 40-50 users (not necessarily all at once). But 40 to 50 users, each with their own laptop or desktop (could not predict which) and 40 to 50 different combinations of apps that each one ran, each app having its own unique drive letter requirements. The drive letter conflicts made it IMPOSSIBLE to use a single drive letter for everyone. So my only solution was UNC mapping for all database FE/BE links AND for all files referenced from the tables and modules from within the database files. Once I implemented that, I never again had a drive-letter problem.

If your current design originates from advice from your network manager, it is time for a come-to-Jesus meeting with that person. I don't care if you show that person this post. I'll answer questions. My qualifications include 28 1/2 years of experience with a U.S. Navy network with over 1200 servers and 80+ major projects including the system that ran the manpower management decisions for the entire U.S. Navy. Trust me when I say that we got that working right in the environment I described. If it meets U.S. Navy standards, it ain't wrong. (Complex? Maybe. Wrong? No.)
 

Users who are viewing this thread

Top Bottom