borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2008 Andrea Tincaniborder

AndreaVB | Forum | News | Downloads | Register | Help | Member List | Statistics | Search | PM | Profile

Print This Topic
Next Topic (Database properties) New Topic New Poll Post Reply
AndreaVB Forum : Database : username/password
Poster Message
emiliana
Level: Scholar

Registered: 27-07-2007
Posts: 29

icon username/password

Hallo,
I'v to manage some files that are resident in a computer (different to my computer)on ethernet network.
My problem is how to connet with the computer where are that files using an Vb6application
, because that computer as differet username/ password to my computer( were's my VB application)?
I know username / password of second computer
Thanks


[Edited by emiliana on 18-12-2007 at 12:04 PM GMT]

17-12-2007 at 10:45 AM
View Profile Send Email to User Show All Posts | Quote Reply
steve_w
Level: Moderator


Registered: 18-04-2003
Posts: 1159
icon Re: username/password

Hi

You could map the drives to your computer see code below.

Option Explicit
' add reference to project "Windows Script Host Object Model"

Private Sub cmdDisconnect_Click()
    
    Dim drv As WshNetwork
    
    Set drv = New WshNetwork
    
    drv.RemoveNetworkDrive "G:"

    Set drv = Nothing

End Sub

Private Sub cmdMap_Click()
    
    Dim drv As WshNetwork
    
    Set drv = New WshNetwork
    
    drv.MapNetworkDrive "G:", "\\OtherComputer\C$", , UserName, password
    
    Set drv = Nothing

End Sub


Merry Christmas

Steve

27-12-2007 at 10:11 PM
View Profile Send Email to User Show All Posts | Quote Reply
emiliana
Level: Scholar

Registered: 27-07-2007
Posts: 29
icon Re: username/password

Hallo,
I'v tried your code, but seems it doesn't work correctly.
The error is that: username or password unknown  ( i'm sure that username / passord programmed are correct)
Attached you will find the error box

Have a very nice new year


____________________________
Attached:
Immagine.zip 3 KB (Downloads: 2)

28-12-2007 at 05:20 AM
View Profile Send Email to User Show All Posts | Quote Reply
steve_w
Level: Moderator


Registered: 18-04-2003
Posts: 1159
icon Re: username/password

The example I put was just to show where the username and password should be. Did you replace these with your values, if you did post your code up and I'll have a look.



[Edited by steve_w on 28-12-2007 at 11:19 AM GMT]

28-12-2007 at 11:19 AM
View Profile Send Email to User Show All Posts | Quote Reply
emiliana
Level: Scholar

Registered: 27-07-2007
Posts: 29
icon Re: username/password

Hi,
Here there are my  vb code:

Private Sub Command1_Click()
Dim drv As WshNetwork
    
    Set drv = New WshNetwork
    
    drv.RemoveNetworkDrive "r:"

    Set drv = Nothing

End Sub

Private Sub Command2_Click()
Dim drv As WshNetwork
    
    Set drv = New WshNetwork
    
    drv.MapNetworkDrive "r:", "\\192.168.253.133\d$", , krause, elvis
    
    Set drv = Nothing

End Sub

28-12-2007 at 11:54 AM
View Profile Send Email to User Show All Posts | Quote Reply
stickleprojects
Level: Moderator


Registered: 09-09-2002
Posts: 925
icon Re: username/password

Hi
try:
drv.MapNetworkDrive "r:", "\\192.168.253.133\d$", , "krause", "elvis"




____________________________
Build it better, faster, quicker, easier.. then fix it (non-offical MS mission statement)

29-12-2007 at 08:41 AM
View Profile Send Email to User Show All Posts | Quote Reply
emiliana
Level: Scholar

Registered: 27-07-2007
Posts: 29
icon Re: username/password

Hi
I have tried but your code doesnt work ( this time i'v a different error than older instruction)
Attacched you will find the debug error


____________________________
Attached:
Immagine.zip 2 KB (Downloads: 1)

29-12-2007 at 09:13 AM
View Profile Send Email to User Show All Posts | Quote Reply
stickleprojects
Level: Moderator


Registered: 09-09-2002
Posts: 925
icon Re: username/password

Try this ms article although there seems to be minor connection issues with xp vs 2k.


____________________________
Build it better, faster, quicker, easier.. then fix it (non-offical MS mission statement)

30-12-2007 at 09:08 AM
View Profile Send Email to User Show All Posts | Quote Reply
stickleprojects
Level: Moderator


Registered: 09-09-2002
Posts: 925
icon Re: username/password

a better link http://www.freevbcode.com/ShowCode.asp?ID=413
was found using google

Hope this helps,
Kieron


____________________________
Build it better, faster, quicker, easier.. then fix it (non-offical MS mission statement)

30-12-2007 at 09:09 AM
View Profile Send Email to User Show All Posts | Quote Reply
emiliana
Level: Scholar

Registered: 27-07-2007
Posts: 29
icon Re: username/password

Hi
I'have look
tanks

02-01-2008 at 06:49 AM
View Profile Send Email to User Show All Posts | Quote Reply
AndreaVB Forum : Database : username/password
Next Topic (Database properties) New Topic New Poll Post Reply
Surf To:


Not Logged In? Username: Password: Lost your password?
Partners: Download Actual Software | Free Software Download
borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2008 Andrea Tincaniborder