question

jhovyn01314 avatar image
jhovyn01314 asked

DTS - Login failed for user

I have a DTS package created and also have Global Variable on it..I'm trying to use the Global Variable created by DTS but I encountered some error.. Error : "Login failed for user dbIDdestCon" Dim oGlobal As DTS.GlobalVariable Dim dbIDdestCon as String Set oGlobal = goPackage.GlobalVariables.New("db_DestID") oGlobal = "sa" dbIDdestCon = oGlobal goPackage.GlobalVariables.Add oGlobal Set oGlobal = Nothing oConnection.Name = "Connection 1" oConnection.id = 1 oConnection.Reusable = True oConnection.ConnectImmediate = False oConnection.DataSource = "*************" oConnection.UserID = "dbIDdestCon" oConnection.ConnectionTimeout = 60 oConnection.Catalog = "**********" oConnection.UseTrustedConnection = False oConnection.UseDSL = False
sql serverdts
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
ThomasRushton avatar image
ThomasRushton answered
I suspect (but I'm not certain) that the problem is with the line Set oGlobal = Nothing It depends (sorry) on whether the line goPackage.GlobalVariables.Add oGlobal works by processing a reference to the oGlobal object, or by creating a copy. If it's a reference, then you setting oGlobal to Nothing will destroy that particular object's values in the GlobalVariables object. Try commenting out that line (the Set oGlobal=Nothing line) and seeing if it works now.
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.