Given a server name, and before logging on to the server - how can I tell if
it's using Windows Authentication Mode or SQL Server Authentication?
I'm retreiving a list of servers as follows:
Dim dmoApp As SQLDMO.Application, dmoServerList As SQLDMO.NameList, srvrNm
As String
dmoApp = New SQLDMO.Application
dmoServerList = dmoApp.ListAvailableSQLServers
For i As Integer = 1 To dmoServerList.Count
srvrNm = dmoServerList.Item(i)
Next i
Thanks in advance for your help,
Hal Heinrich
VP Technology
Aralan Solutions Inc.Hal,
SQL Server always defaults to using Windows Authentication; it is up to the
developer to determine which authentication method to use.
And if you use some tool to generate the connection string for you, the
default will be to use Windows Authentication. This can be seen in the
connection string by the following line:
Integrated Security=SSPI
If that data|value pair is present, then your connection will use the
Windows Authentication mode. Simply remove this data|value pair from your
connection string and then you will be using the SQL Server Authentication
and be required to include user and password values.
Hope that helps.
Richard
"Hal Heinrich" wrote:
> Given a server name, and before logging on to the server - how can I tell
if
> it's using Windows Authentication Mode or SQL Server Authentication?
> I'm retreiving a list of servers as follows:
> Dim dmoApp As SQLDMO.Application, dmoServerList As SQLDMO.NameList, srvrNm
> As String
> dmoApp = New SQLDMO.Application
> dmoServerList = dmoApp.ListAvailableSQLServers
> For i As Integer = 1 To dmoServerList.Count
> srvrNm = dmoServerList.Item(i)
> Next i
> Thanks in advance for your help,
> Hal Heinrich
> VP Technology
> Aralan Solutions Inc.
>
No comments:
Post a Comment