处理多维数据集的VB6程序

'****************************************************************
'Microsoft SQL Server 2000
'Visual Basic file generated for DTS Package
'File Name: C:/Documents and Settings/maintain/桌面/ProcessCube.bas
'Package Name: ProcessCube
'Package Description:
'Generated Date: 2004-6-11
'Generated Time: 9:37:31
'****************************************************************

Option Explicit
Public goPackageOld As New DTS.Package
Public goPackage As DTS.Package2
Private Sub Main()
 set goPackage = goPackageOld

 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
 


'---------------------------------------------------------------------------
' create package steps information
'---------------------------------------------------------------------------

Dim oStep as DTS.Step2
Dim oPrecConstraint as DTS.PrecedenceConstraint

'------------- a new step defined below

Set oStep = goPackage.Steps.New

 oStep.Name = "DTSStep_DTSOlapProcess.Task_1"
 oStep.Description = "Analysis Services 处理任务: 未定义"
 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 oStep
Set oStep = Nothing

'---------------------------------------------------------------------------
' create package tasks information
'---------------------------------------------------------------------------

'------------- call Task_Sub1 for task DTSOlapProcess (Analysis Services 处理任务: 未定义)
Call Task_Sub1( goPackage )

'---------------------------------------------------------------------------
' Save or execute package
'---------------------------------------------------------------------------

'goPackage.SaveToSQLServer "(local)", "sa", ""
goPackage.Execute
tracePackageError goPackage
goPackage.Uninitialize
'to save a package instead of executing it, comment out the executing package lines above and uncomment the saving package line
set goPackage = Nothing

set goPackageOld = Nothing

End Sub


'-----------------------------------------------------------------------------
' error reporting using step.GetExecutionErrorInfo after execution
'-----------------------------------------------------------------------------
Public Sub tracePackageError(oPackage As DTS.Package)
Dim ErrorCode As Long
Dim ErrorSource As String
Dim ErrorDescription As String
Dim ErrorHelpFile As String
Dim ErrorHelpContext As Long
Dim ErrorIDofInterfaceWithError As String
Dim i As Integer

 For 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 & ErrorDescription
  End If
 Next i

End Sub

'------------- define Task_Sub1 for task DTSOlapProcess (Analysis Services 处理任务: 未定义)
Public Sub Task_Sub1(ByVal goPackage As Object)

Dim oTask As DTS.Task
Dim oLookup As DTS.Lookup

Dim oCustomTask1 As DTSOlapProcess.Task
Set oTask = goPackage.Tasks.New("DTSOlapProcess.Task")
oTask.Name = "DTSOlapProcess"
Set oCustomTask1 = oTask.CustomTask

 oCustomTask1.Name = "DTSOlapProcess"
 oCustomTask1.Description = "Analysis Services 处理任务: 未定义"
 oCustomTask1.TreeKey = "CPT-EXTDOMAIN/FoodMart 2000/CubeFolder/Sales"
 oCustomTask1.ItemType = 4
 oCustomTask1.ProcessOption = 0
 oCustomTask1.Datasource = "FoodMart"
 oCustomTask1.FactTable = """sales_fact_1997"""
 oCustomTask1.IncrementallyUpdateDimensions = False
 
goPackage.Tasks.Add oTask
Set oCustomTask1 = Nothing
Set oTask = Nothing

End Sub

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值