Previous Thread

8/16/2006 3:36:28 PM    Reading files from a drive
I've got a strange one for you access Guru's. 
 
Everyday we download txt files and my access program extracts the data from 
 
the files and puts them into a table. 
 
When the user I have created the program for tries to run the program, no 
 
files are found.  when I run the program the files are found. 
 
* The user has full access rights to the folder and parent folders 
 
* The user can access the directory through command prompt and GUI 
 
* the user 
 
* When I log into his computer I can access the files through access 
 
* The user cannot access the files whilst logged onto another computer. 
 
* If the path is set to a local directory, it works. 
 
* the program was working for 6 weeks for the user and nothing has changed 
 
except the program now doesn't work for this user. 
 
Code used 
 
ChDir ("\\HOBS\HobsInsolDownloads\") 
 
strfile = Dir("insolgroup*.*") 
 
Do While Len(strfile) > 0



8/16/2006 10:14:20 PM    Re: Reading files from a drive
Hi Chris, 
 
I think the problem is that this 
 
changes the current directory *in the share \\HOBS* but this 
 
looks in the current directory in the current drive (typically C:). 
 
AFAIK you can't set the current drive to an unmapped network share, so 
 
the options appear to be 
 
1) map the share to the same drive letter in all computers (e.g. Q:) and 
 
use 
 
ChDir "Q:\HobsInsolDownloads" 
 
ChDrive "Q" 
 
strFile = Dir("insolgroup*.*) 
 
2) use the UNC path throughout (The VBA Dir() function appears to accept 
 
UNC, though I don't know whether this is 100% the case.) 
 
strFile = Dir("\\HOBS\HobsInsolDownloads\insolgroup*.*) 
 
-- 
 
John Nurick [Microsoft Access MVP] 
 
Please respond in the newgroup and not by email.

8/17/2006 4:42:08 PM    Re: Reading files from a drive
Thanks you were dead right! 
 
"John Nurick" <j.mapSoN.nurick@dial.pipex.com> wrote in message 
 
news:o327e25aikb8dhncsqo4rb5k3pn4h8hakq@4ax.com...