Click here to monitor SSC
SQLServerCentral is supported by Redgate
Log in  ::  Register  ::  Not logged in
Home       Members    Calendar    Who's On

Add to briefcase

Windows Authentication Expand / Collapse
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: Wednesday, June 8, 2016 3:45 AM
Points: 30, Visits: 403
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
End Function
Post #1023697
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse