[AccessD] Get path from full file name

Gustav Brock gustav at cactus.dk
Sat Oct 25 04:34:58 CDT 2003


Hi Lambert

Sorry, I missed your point. You are right, of course \\fs1\sys\ is the
highest possible level for a file.

By second thought I think one should distinguish between (1) obtaining
the path from a full filename ("GetPath") and (2) validating this path
("ValidatePath").
Validating is not needed if you somehow know the file exists or, say,
the user has used the GUI to browse to a folder. Thus "GetPath" can be
kept as a very simple function.
"ValidatePath", when needed, can follow two routes: one if the path is
supposed to exist and another if you just wish to validate if your
string could equal to a possible path; this latter is the tough part
checking drive letters, colons in the wrong place, double slashes,
invalid characters etc.

So, to simplify our task, we have decided not to build the path if it
is not found but to let the user browse to the folder; this eliminates
the need for "ValidatePath" and prevents many possible errors. Now we
can go with an "IsDir" which later checks if the path (folder) still
exists when the user actually needs it.

No, I didn't play with InstrR or similar.

/gustav


> Sigh... ;-(

> <pedant mode>

> \\fs1\sys\database\client1\somedb.mdb is a complete file "specification"
> which is composed of the storage device (in this case a file server called
> \\fs1), the *path* to the file and the file name.

> </pedant mode>

> That's what I meant by "Strictly speaking". I didn't write the definitions,
> so please don't shoot the messenger. :-)

> Of course I'm aware that using a fully qualified UNC file spec is accepted
> by Access, I do it all the time myself. I just hate having to deal with
> differently mapped drive letters of different user's systems.

> I too would recommend an absolute file specification be used for most
> purposes. With today's multi-tasking operating systems and multi threaded
> applications the "current" folder can never be guaranteed to stay put.

> InstrR() ???

> Lambert



More information about the AccessD mailing list