dbTalk Databases Forums  

Failure when setting a password for a connection in VB

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss Failure when setting a password for a connection in VB in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
JosepValles
 
Posts: n/a

Default Failure when setting a password for a connection in VB - 08-20-2004 , 07:39 AM






The code below fails to initialize the password of a connection in a DTS
transaction using SQLServer security. Please help!

Thanks a lot

Dim objPackage As DTS.Package2

objPackage = New DTS.Package2
objPackage.LoadFromSQLServer(cdlManagementXml.IPHo stDB,
cdlManagementXml.UsernameUpd,
cdlManagementXml.PasswordUpd, , "", "", "", "DTS1", "")

objPackage.Connections.Item(1).DataSource = cdlManagementXml.IPHostDB
objPackage.Connections.Item(1).Catalog = cdlManagementXml.DataBaseName
objPackage.Connections.Item(1).UseTrustedConnectio n = False
objPackage.Connections.Item(1).UserID = cdlManagementXml.UsernameUpd

'----- cdlManagementXml.PasswordUpd evaluates to correct password!

objPackage.Connections.Item(1).Password = cdlManagementXml.PasswordUpd

'------ cdlManagementXml.PasswordUpd evaluates to correct password but
'------ objPackage.Connections.Item(1).Password.Value evaluates to Nothing!

'------ some more code here

objPackage.Execute()

'------- error

Reply With Quote
  #2  
Old   
Darren Green
 
Posts: n/a

Default Re: Failure when setting a password for a connection in VB - 08-20-2004 , 09:34 AM






How do you check to see if the pasword is not set ? If you just try and
read back teh value you set then you will always get nothing, as teh
password property is write only.

If you set the value but it doesn't stick such that when run the package you
get a login error, it may be the Persist Security Info property being set to
false.

Recurring login failed for user 'xyz' errors
(http://www.sqldts.com/default.aspx?267)


--
Darren Green
http://www.sqldts.com

"JosepValles" <JosepValles (AT) discussions (DOT) microsoft.com> wrote

Quote:
The code below fails to initialize the password of a connection in a DTS
transaction using SQLServer security. Please help!

Thanks a lot

Dim objPackage As DTS.Package2

objPackage = New DTS.Package2
objPackage.LoadFromSQLServer(cdlManagementXml.IPHo stDB,
cdlManagementXml.UsernameUpd,
cdlManagementXml.PasswordUpd, , "", "", "", "DTS1", "")

objPackage.Connections.Item(1).DataSource = cdlManagementXml.IPHostDB
objPackage.Connections.Item(1).Catalog = cdlManagementXml.DataBaseName
objPackage.Connections.Item(1).UseTrustedConnectio n = False
objPackage.Connections.Item(1).UserID = cdlManagementXml.UsernameUpd

'----- cdlManagementXml.PasswordUpd evaluates to correct password!

objPackage.Connections.Item(1).Password = cdlManagementXml.PasswordUpd

'------ cdlManagementXml.PasswordUpd evaluates to correct password but
'------ objPackage.Connections.Item(1).Password.Value evaluates to
Nothing!

'------ some more code here

objPackage.Execute()

'------- error



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.