Map drive weirdness

char1iecha1k
06-09-2005, 02:44 AM
Hi

I am trying to write a vb6 app for mapping users folder but something funny is going on (We are not using a domain, hence the reason for this program)

On the main form i have 2 buttons "disconnect" and "connect" (and a space for username and password)

The disconnect button calls a routine which disconnects all the network drives, and the connect button calls the same routine to disconnect all drives and then another routine to re-map them with the new users details.

When person A switches PC on and logs in he gets all his drives, and when he logs off all drives are removed (Thus both my subroutines are working). HOWEVER if person B tries logging in by pressing disconnect then connect (assuming A is still logged in) it all works fine, BUT if instead of disconnecting first and simply pressing the connect button it comes up with error 1219 (see end of post for error meaning)

This is odd because in both cases the same routine is being called. The difference is that the disconnect and connect processes are happening in different events. When it happens in the same event it doesnt work which is odd since the disconnect part works fine and there arent any drives connected so why does it error in this way and how do i fix it?

ERROR_SESSION_CREDENTIAL_CONFLICT
1219 Multiple connections to a server or shared resource by the same user, using more than one user name, are not allowed. Disconnect all previous connections to the server or shared resource and try again.

spikey_richie
06-09-2005, 04:56 AM
You could force the disconnect routine to run before a connect (from within the connect routine).

char1iecha1k
06-09-2005, 05:16 AM
and the connect button calls the same routine to disconnect all drives and then another routine to re-map them

as you can see i am already doing that, that is the weird bit it only works when run seperately

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum