Wrox Programmer Forums
Go Back   Wrox Programmer Forums > SQL Server > SQL Server DTS
|
SQL Server DTS Discussion specific to Data Transformation Service with SQL Server. General SQL Server discussions should use the general SQL Server forum. Readers of the book Professional SQL Server 2000 DTS with questions specific to that book should post in that book forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server DTS section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 7th, 2005, 09:09 AM
sjm sjm is offline
Registered User
 
Join Date: Aug 2005
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default Problem with EnumPackageInfos and EnumStepLogRecor


The script displayed below is being used to display some information about the package and log to some messageboxes (presently). The EnumPackageRecords works fine and returns all the data it should. EnumPackageInfos and EnumStepLogRecords do not return any data or display their messagebox. No error is given. I am having difficulty in determining why this is occurring. All three operate very similarly as I understand it. I am interested in comments and suggestions on this problem.


'Init Variables for EnumPackageRecords Data
    dim strName
    dim strDescription
    dim strPackageID
    dim strLineageFullID
    dim strLineageShortID
    dim strComputer
    dim strOperator
    dim strLogDate
    dim strExecutionTime
    dim strStartTime
    dim strFinishTime
    dim strErrorCode
    dim strErrorDescription

'Init Variables for EnumPackageInfos Data
    dim colPackageInfo
    dim objPackageInfo

'Init Variables for EnumStepLogRecords Data
    dim colStepLogRecords
    dim objStepLogRecords

'Init Variables for Misc
    dim app
    dim coll
    dim pkg
    dim pss
    dim opi


    set pkg = DTSGlobalVariables.parent

    set app = CREATEOBJECT("DTS.Application")

    set pss = app.GetPackageSQLServer( "SERVER", "", "", DTSSQLStgFlag_UseTrustedConnection)

    set coll = pss.EnumPackageLogRecords(pkg.name, True, "", pkg.VersionID, "")
    set colPackageInfo = pss.EnumPackageInfos(pkg.name, True, pkg.VersionID)

    set opi = coll.Next
    set objPackageInfo = colPackageInfo.Next

    do until coll.EOF
        msgbox ( "Name: " & opi.Name & _
            vbCrLf & "Description: " & opi.Description & _
            vbCrLf & "PackageID: " & opi.PackageID & _
            vbCrLf & "LineageFullID: " & opi.LineageFullID & _
            vbCrLf & "LineageShortID: " & opi.LineageShortID & _
            vbCrLf & "Computer: " & opi.Computer & _
            vbCrLf & "Operator: " & opi.Operator & _
            vbCrLf & "LogDate: " & opi.LogDate & _
            vbCrLf & "ExecutionTime: " & opi.ExecutionTime & _
            vbCrLf & "StartTime: " & opi.StartTime & _
            vbCrLf & "FinishTime: " & opi.FinishTime & _
            vbCrLf & "ErrorCode: " & opi.ErrorCode & _
            vbCrLf & "ErrorDescription: " & opi.ErrorDescription )
        strName = opi.Name
        strDescription = opi.Description
        strPackageID = opi.PackageID
        strLineageFullID = opi.LineageFullID
        strLineageShortID = opi.LineageShortID
        strComputer = opi.Computer
        strOperator = opi.Operator
        strLogDate = opi.LogDate
        strExecutionTime = opi.ExecutionTime
        strStartTime = opi.StartTime
        strFinishTime = opi.FinishTime
        strErrorCode = opi.ErrorCode
        strErrorDescription = opi.ErrorDescription

        set opi = coll.Next
    Loop
'EnumPackageInfos
    do until colPackageInfo.EOF
        msgbox ("CreationDate: " & objPackageInfo.CreationDate & _
            vbCrLf & "Description: " & objPackageInfo.Description & _
            vbCrLf & "IsOwner: " & objPackageInfo.IsOwner & _
            vbCrLf & "Name: " & objPackageInfo.Name & _
            vbCrLf & "Owner: " & objPackageInfo.Owner & _
            vbCrLf & "PackageDataSize: " & objPackageInfo.PackageDataSize & _
            vbCrLf & "PackageID: " & objPackageInfo.PackageID & _
            vbCrLf & "PackageType" & objPackageInfo.PackageType & _
            vbCrLf & "PackageInfo: " & objPackageInfo.VersionID _
            )
        set objPackageInfo = colPackageInfo.Next
    Loop

'EnumStepLogRecords
    set colStepLogRecords = pss.EnumStepLogRecords(strLineageFullID, "")
    set objStepLogRecords = colStepLogRecords.Next

    do until colStepLogRecords.EOF
        msgbox ("ErrorCode: " & objStepLogRecords.ErrorCode & _
            vbCrLf & "ErrorDescription: " & objStepLogRecords.ErrorDescription & _
            vbCrLf & "ExecutionTime: " & objStepLogRecords.ExecutionTime & _
            vbCrLf & "FinishTime: " & objStepLogRecords.FinishTime & _
            vbCrLf & "LineageFullID: " & objStepLogRecords.LineageFullID & _
            vbCrLf & "Name: " & objStepLogRecords.Name & _
            vbCrLf & "ProgressCount: " & objStepLogRecords.ProgressCount & _
            vbCrLf & "StartTime: " & objStepLogRecords.StartTime & _
            vbCrLf & "StepExecutionID: " & objStepLogRecords.StepExecutionID & _
            vbCrLf & "StepExecutionResult: " & objStepLogRecords.StepExecutionResult _
            )

        set objStepLogRecords = colStepLogRecords.Next

    Loop
 
Old September 8th, 2005, 07:38 AM
sjm sjm is offline
Registered User
 
Join Date: Aug 2005
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default


I have figured out the problem with EnumStepLogRecords. I had an empty string where a NULL needed to be, i.e.

set colStepLogRecords = pss.EnumStepLogRecords(strLineageFullID, "")

set colStepLogRecords = pss.EnumStepLogRecords(strLineageFullID, NULL)

EnumStepLogRecords now works fine, but EnumPackageInfos does not.

 
Old September 8th, 2005, 10:57 AM
sjm sjm is offline
Registered User
 
Join Date: Aug 2005
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

With regard to the EnumPackageInfos, for some reason, putting an empty string for the versionid works, while putting the guid for the versionid does not. I am unclear on why this is the case, but I am happy that the results I desire are occurring.

set colPackageInfo = pss.EnumPackageInfos(pkg.name, True, "")

set colPackageInfo = pss.EnumPackageInfos(pkg.name, True, pkg.VersionID)














Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.