Handling the VB6 program for cubes

zhaozj2021-02-16  49

'********************************************************** *************** The Microsoft SQL Server 2000'visual Basic File Generated for DTS Package'File Name: C: / Documents and Settings / Maintain / Desktop /ProcessCube.bas'Package Name: PROCESSCUBE'Package Description: 'generated date: 2004-6-11'generated Time: 9:37:31' *********************************** ***********************************************

Option Explicitpublic GopackageOLD As New DTS.PackagePublic Gopackage As DTS.Package2Private Sub Main () SET GOPACKAGE = GOPAGKAGEOLD

goPackage.Name = "ProcessCube" goPackage.WriteCompletionStatusToNTEventLog = False goPackage.FailOnError = False goPackage.PackagePriorityClass = 2 goPackage.MaxConcurrentSteps = 4 goPackage.LineageOptions = 0 goPackage.UseTransaction = True goPackage.TransactionIsolationLevel = 4096 goPackage.AutoCommitTransaction = True goPackage.RepositoryMetadataOptions = 0 goPackage.UseOLEDBServiceComponents = True goPackage.LogToSQLServer = False goPackage.LogServerFlags = 0 goPackage.FailPackageOnLogFailure = False goPackage.ExplicitGlobalVariables = False goPackage.PackageType = 0

'------------------------------------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ -------------------------------------------------- -------

Dim Ostep as dts.step2dim Oprecconstraint as dts.precedenceConstraint

'------------- A New Step Defined Below

Set ostep = GOPACKAGE.STEPS.NEW

oStep.Name = "DTSStep_DTSOlapProcess.Task_1" oStep.Description = "Analysis Services processing task: Undefined" oStep.ExecutionStatus = 1 oStep.TaskName = "DTSOlapProcess" oStep.CommitSuccess = False oStep.RollbackFailure = False oStep.ScriptLanguage = "VBScript "oStep.AddGlobalVariables = True oStep.RelativePriority = 3 oStep.CloseConnection = False oStep.ExecuteInMainThread = True oStep.IsPackageDSORowset = False oStep.JoinTransactionIfPresent = False oStep.DisableStep = False oStep.FailPackageOnError = False goPackage.Steps.Add oStepSet oStep = Nothing '------------------------------------- -------------------------- 'Create Package Tasks Information' ------------------ -------------------------------------------------- -------

'------------- Call Task_sub1 for Task DTSOLAPPROCESS (Analysis Services Processing Tasks: Undefined) Call Task_Sub1 (GOPAckage)

'------------------------------------- -------------------------- 'Save or Execute package' ------------------ -------------------------------------------------- -------

'GoPackage.SaveToSQLServer "(local)", "sa", "" goPackage.ExecutetracePackageError goPackagegoPackage.Uninitialize'to save a package instead of executing it, comment out the executing package lines above and uncomment the saving package lineset goPackage = Nothing

Set gopackageold = nothing

End Sub

'------------------------------------- ---------------------------- 'Error Reporting Using Step.GetexecutionerrorInfo After Execution' ------------ -------------------------------------------------- --------------- Public Sub tracePackageError (oPackage As DTS.Package) Dim ErrorCode As LongDim ErrorSource As StringDim ErrorDescription As StringDim ErrorHelpFile As StringDim ErrorHelpContext As LongDim ErrorIDofInterfaceWithError As StringDim i As IntegerFor i = 1 To oPackage.Steps.Count If oPackage.Steps (i) .ExecutionResult = DTSStepExecResult_Failure Then oPackage.Steps (i) .GetExecutionErrorInfo ErrorCode, ErrorSource, ErrorDescription, _ ErrorHelpFile, ErrorHelpContext, ErrorIDofInterfaceWithError MsgBox oPackage.Steps (i) .Name & "failed & vbcrlf & errorsource & vbcrlf & errotescription End if Next i

End Sub

'------------- Define Task_sub1 for Task DTSOLAPPROCESS (Analysis Services Processing Tasks: Undefined) Public Sub Task_sub1 (Byval Gopackage As Object)

Dim Otask As DTS.Taskdim Olookup As DTS.lookup

DTSOLAPPROCESS.TASKSET OTASK = GOPACKAGE.TASKS.NEW ("DTSOLAPPROCESS.TASK") Otask.Name = "DTSOLAPPROCESS" Set OcustomTask1 = Otask.customtask

oCustomTask1.Name = "DTSOlapProcess" oCustomTask1.Description = "Analysis Services processing task: Undefined" oCustomTask1.TreeKey = "CPT-EXTDOMAIN / FoodMart 2000 / CubeFolder / Sales" oCustomTask1.ItemType = 4 oCustomTask1.ProcessOption = 0 oCustomTask1.Datasource = "Foodmart" Ocustomtask1.FACTTABLE = "" "" "" "" ocustomtask1.incremenTaPdatedImensions = false gopage.tasks.add otaskset otustomtask1 = nothingset Otask = Nothingend Sub

转载请注明原文地址:https://www.9cbs.com/read-21523.html

New Post(0)