UNC drive disconnect fails

  • Thread starter Thread starter Brian Cook
  • Start date Start date
B

Brian Cook

I have a VB6 program that maps a unc drive to run. When
shutting down the program the unc drive is not
disconnected and reports a sharing violation. we start the
program using unc \\server\shared\prog.exe. Does any one
know how to disconnect the drive in VB or when the drive
is disconnected.
 
Brian Cook said:
I have a VB6 program that maps a unc drive to run. When
shutting down the program the unc drive is not
disconnected and reports a sharing violation. we start the
program using unc \\server\shared\prog.exe. Does any one
know how to disconnect the drive in VB or when the drive
is disconnected.

Make sure you have no open files on that drive.

You should be able to verify the validity of your code
by modifying it so that it connects to the share in one
line of code, then disconnects in the next line. Since
no files were opened, the drive should disconnect
straight away.
 
-----Original Message-----



Make sure you have no open files on that drive.

You should be able to verify the validity of your code
by modifying it so that it connects to the share in one
line of code, then disconnects in the next line. Since
no files were opened, the drive should disconnect
straight away.


.
What if the VB program is started from the same unc
path. I think my problem is that drive will not be
disconnected until I exit the program and if I exit the
program I can not run the disconnect.
 
Brian Cook said:
path. I think my problem is that drive will not be
disconnected until I exit the program and if I exit the
program I can not run the disconnect.

That's easily tested: Start the VB program from
somewhere else and see what happens!
 
Back
Top