dbTalk Databases Forums  

extract filename from a UNC style path

comp.databases.ms-access comp.databases.ms-access


Discuss extract filename from a UNC style path in the comp.databases.ms-access forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
bobh
 
Posts: n/a

Default extract filename from a UNC style path - 09-12-2011 , 03:43 PM






Hi All,

In AccessXP using Left, Mid, Instr, or whatever works I'm look to
extract just the file name from a UNC style given path as in;

"\\Dfs01\shared\HAN\SHARED1\CLOps\CLCommon\Project sTracker\Apps
\StrStorage.dll"

I've tried several combinations in vba code but failed to extract just
StrStorage.dll......

thanks
bobh.

Reply With Quote
  #2  
Old   
ron paii
 
Posts: n/a

Default Re: extract filename from a UNC style path - 09-12-2011 , 04:10 PM






mid("\\Dfs01\shared\HAN\SHARED1\CLOps\CLCommon\Pro jectsTracker\Apps\StrStorage.dll",instrrev("\\Dfs0 1\shared\HAN\SHARED1\CLOps\CLCommon\ProjectsTracke r\Apps\StrStorage.dll","\")+1)

"bobh" <vulcaned (AT) yahoo (DOT) com> wrote

Quote:
Hi All,

In AccessXP using Left, Mid, Instr, or whatever works I'm look to
extract just the file name from a UNC style given path as in;

"\\Dfs01\shared\HAN\SHARED1\CLOps\CLCommon\Project sTracker\Apps
\StrStorage.dll"

I've tried several combinations in vba code but failed to extract just
StrStorage.dll......

thanks
bobh.

Reply With Quote
  #3  
Old   
bobh
 
Posts: n/a

Default Re: extract filename from a UNC style path - 09-12-2011 , 07:19 PM



On Sep 12, 5:10*pm, "ron paii" <n... (AT) nospam (DOT) com> wrote:
Quote:
mid("\\Dfs01\shared\HAN\SHARED1\CLOps\CLCommon\Pro jectsTracker\Apps\StrStor*age.dll",instrrev("\\Dfs 01\shared\HAN\SHARED1\CLOps\CLCommon\ProjectsTrack e*r\Apps\StrStorage.dll","\")+1)

"bobh" <vulca... (AT) yahoo (DOT) com> wrote in message

news:d095dbc9-1801-415c-8664-23fe17ad1f19 (AT) bi2g2000vbb (DOT) googlegroups.com...



Hi All,

In AccessXP using Left, Mid, Instr, *or whatever works *I'm look to
extract just the file name from a UNC style given path as in;

"\\Dfs01\shared\HAN\SHARED1\CLOps\CLCommon\Project sTracker\Apps
\StrStorage.dll"

I've tried several combinations in vba code but failed to extract just
StrStorage.dll...... *

thanks
bobh.- Hide quoted text -

- Show quoted text -
Perfect!!! works great!! thanks!
bobh.

Reply With Quote
  #4  
Old   
Tony Toews
 
Posts: n/a

Default Re: extract filename from a UNC style path - 09-13-2011 , 07:02 PM



On Mon, 12 Sep 2011 16:10:37 -0500, "ron paii" <none (AT) nospam (DOT) com>
wrote:

Quote:
mid("\\Dfs01\shared\HAN\SHARED1\CLOps\CLCommon\Pro jectsTracker\Apps\StrStorage.dll",instrrev("\\Dfs0 1\shared\HAN\SHARED1\CLOps\CLCommon\ProjectsTracke r\Apps\StrStorage.dll","\")+1)
I keep forgeting about instrrev. I also don't recall what version it
was introduced in. Likely in A2000 or A97.

Thanks for the reminder.

Tony
--
Tony Toews, Microsoft Access MVP
Tony's Main MS Access pages - http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/
For a convenient utility to keep your users FEs and other files
updated see http://www.autofeupdater.com/

Reply With Quote
  #5  
Old   
ron paii
 
Posts: n/a

Default Re: extract filename from a UNC style path - 09-14-2011 , 07:18 AM



"Tony Toews" <ttoews (AT) telusplanet (DOT) net> wrote

Quote:
On Mon, 12 Sep 2011 16:10:37 -0500, "ron paii" <none (AT) nospam (DOT) com
wrote:

mid("\\Dfs01\shared\HAN\SHARED1\CLOps\CLCommon\Pro jectsTracker\Apps\StrStorage.dll",instrrev("\\Dfs0 1\shared\HAN\SHARED1\CLOps\CLCommon\ProjectsTracke r\Apps\StrStorage.dll","\")+1)

I keep forgeting about instrrev. I also don't recall what version it
was introduced in. Likely in A2000 or A97.

Thanks for the reminder.

Tony
--
Tony Toews, Microsoft Access MVP
Tony's Main MS Access pages - http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/
For a convenient utility to keep your users FEs and other files
updated see http://www.autofeupdater.com/
Just discovered it, I needed to extract the extension from file names that
have multiple periods.
Moved from A97 to A2010; Don't think A97 had it.

Reply With Quote
  #6  
Old   
Bob Barrows
 
Posts: n/a

Default Re: extract filename from a UNC style path - 09-14-2011 , 07:33 AM



ron paii wrote:
Quote:
"Tony Toews" <ttoews (AT) telusplanet (DOT) net> wrote in message
news:0mrv67psor4g7qp61ciu1h4ad229i05bbe (AT) 4ax (DOT) com...
On Mon, 12 Sep 2011 16:10:37 -0500, "ron paii" <none (AT) nospam (DOT) com
wrote:

mid("\\Dfs01\shared\HAN\SHARED1\CLOps\CLCommon\Pro jectsTracker\Apps\StrStorage.dll",instrrev("\\Dfs0 1\shared\HAN\SHARED1\CLOps\CLCommon\ProjectsTracke r\Apps\StrStorage.dll","\")+1)

I keep forgeting about instrrev. I also don't recall what version it
was introduced in. Likely in A2000 or A97.

Thanks for the reminder.


Just discovered it, I needed to extract the extension from file names
that have multiple periods.
Moved from A97 to A2010; Don't think A97 had it.
You could get it in A97 by adding a reference to the Windows Scripting
Runtime dll.

Reply With Quote
  #7  
Old   
David-W-Fenton
 
Posts: n/a

Default Re: extract filename from a UNC style path - 09-15-2011 , 12:47 PM



"Bob Barrows" <reb01501 (AT) NOSPAMyahoo (DOT) com> wrote in
news:j4q6pu$h0p$1 (AT) dont-email (DOT) me:

Quote:
You could get it in A97 by adding a reference to the Windows
Scripting Runtime dll.
....which is saying that it WAS NOT in A97. I think it was introduced
in the A2002/2003 time frame. Nope, I'm wrong -- it was in A2000.

--
David W. Fenton http://www.dfenton.com/
contact via website only http://www.dfenton.com/DFA/

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.