PRB: DTS Connection Password Is Write Only (259571)



The information in this article applies to:

  • Microsoft SQL Server 7.0 Service Pack 2
  • Microsoft SQL Server 2000 (all editions)

This article was previously published under Q259571

SYMPTOMS

In a logical expression, the comparison of the Data Transformation Services (DTS) Connection Object password will always return false and an empty string will be returned when attempting to display the password. This only occurs after installing Service Pack 2 for SQL Server 7.0.

This behavior is by design.

MORE INFORMATION

The accessibility to the password property for the DTS Connection Object has been changed to write only. This means that, when using the DTS Package Object Library or Active script task, the Connection Object password will not be able to be displayed, read, or used in a logical expression. This will affect packages and code that currently rely on this behavior.

The change was made for security reasons.

The code below demonstrates the behavior of not displaying the password or being able to compare it.
Dim oPackage As DTS.Package
Dim oConn   As DTS.Connection

Set oPackage = New DTS.Package
oPackage.LoadFromSQLServer "Server", "SA", "", DTSSQLStgFlag_Default, "", "", "", "Test"
Set oConn = oPackage.Connections.Item("Microsoft OLE DB Provider for SQL Server")

oConn.Password = "Test"
Debug.Print oConn.Password      ' Will print nothing
If oConn.Password = "Test" Then ' comparison will always return false
    Debug.Print "Its the same"
Else
    Debug.Print "Its different"
End If

Set oConn = Nothing
Set oPackage = Nothing
				

Modification Type:MajorLast Reviewed:6/24/2004
Keywords:kbDatabase kbprb kbSQLProg KB259571