Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
M.Thelian
Starting Member
2 Posts |
Posted - 2002-07-19 : 03:54:55
|
| Hi!I try to modify a list of DTS-Packages within a 'ActiveX ScriptTask' of an DTS-Package.Here is my sourcecode:--------------dim sPkgNameFunction Main() dim RS, countr 'the recordset that contains the packagename-list set RS = CreateObject("ADODB.Recordset") set RS = DTSGlobalVariables("DTS_Names").value for countr = 1 to RS.RecordCount sPkgName = RS.Fields("name").value Modify_Package() RS.MoveNext Next Main = DTSTaskExecResult_SuccessEnd FunctionFunction Modify_Package() Dim oPkg, sServer, sUID, sPWD, oConnection, iSecurity , sPkgPWD Set oPkg = CreateObject("DTS.Package") Set sServer = "servername" Set sUID = "yyy" Set sPWD = "yyy" Set iSecurity = DTSSQLStgFlag_Default Set sPkgPWD = "" On Error Resume Next ' Load Package oPkg.LoadFromSQLServer sServer, sUID, sPWD, iSecurity , _ sPkgPWD, "", "", sPkgName If (Err.Number <> 0) Then MsgBox ("Errormessage: " & Err.Description & _ " Errorcode: " & Err.Number) Err.Clear exit function else ' Examine Connections For Each oConnection in oPkg.Connections If (oConnection.DataSource="DataSourceToReplace") then oConnection.DataSource = "newDataSource" 'save modified package oPkg.SaveToSQLServer sServer, sUID, sPWD End If Next end if Set oConnection = Nothing Set oPkg = Nothing End Function--------------The problem is, that if I try to load an encrypted package, I get theerrormessage: "Cannot load encrypted package without a password." withthe errorcode: -2147220454. That's ok, but for the next packages inthe packagelist I get the errormessage: "" with the same errorcode,even if the packages are not enrypted and could be loaded without apassword.What can I do?I'm using the MS-SQL Server Standard Edition, Version 7.00.961Martin |
|
|
Page47
Master Smack Fu Yak Hacker
2878 Posts |
Posted - 2002-07-19 : 11:30:21
|
| In your for loop, tell it to skip the encrypted package(s).<O> |
 |
|
|
M.Thelian
Starting Member
2 Posts |
Posted - 2002-07-22 : 02:23:46
|
| > In your for loop, tell it to skip the encrypted package(s).How can I find out if a package is encrypted? |
 |
|
|
|
|
|
|
|