Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Windows Authentication Expand / Collapse
Author
Message
Posted Friday, November 19, 2010 10:44 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Tuesday, December 2, 2014 8:23 AM
Points: 29, Visits: 381
The below code uses windows authentication, but If I want to override the current logon credentials and use a different userId and password what do I need to change : oServer.LoginSecure = True

Foe example the current windows logon is : AD\micky, but I want list all servers using a different user as AD\mouse.


Function listDatabases(vServer As String, vControl As Object)
Dim oServer As SQLDMO.SQLServer
Set oServer = New SQLDMO.SQLServer

oServer.LoginSecure = True
oServer.Connect vServer
For Each oDatabase In oServer.Databases
vControl.AddItem oDatabase.Name
Next
End Function
Post #1023697
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse