Newsgroup: it.comp.lang.visual-basic
Titolo: Eseguire DTS Package SQL Server 7.0

Vorrei sapere se è possibile, da un applicativo VB6, eseguire un package DTS
definito su un server SQL 7.0 e come.
Grazie.
Giorgio

Questo codice me l'ha creato automaticamente SQL 2000 (tramite un'opzione)..
Ho fatto un copia incolla
Ciao..
oZ
'****************************************************************
'Microsoft SQL Server 2000
'Visual Basic file generated for DTS Package
'File Name: C:\Documents and Settings\Administrator\Documenti\Nuovo
pacchetto.bas
'Package Name: Nuovo pacchetto
'Package Description: Descrizione pacchetto DTS
'Generated Date: 19/02/2002
'Generated Time: 14.35.10
'****************************************************************
Option Explicit
Public goPackageOld As New DTS.Package
Public goPackage As DTS.Package2
Private Sub Main()
        Set goPackage = goPackageOld
        goPackage.Name = "Nuovo pacchetto"
        goPackage.Description = "Descrizione pacchetto DTS"
        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 oConnProperty As DTS.OleDBProperty
'---------------------------------------------------------------------------
' 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 = "Copia oggetti SQL Server"
        oStep.Description = "Copia oggetti SQL Server"
        oStep.ExecutionStatus = 1
        oStep.TaskName = "Copia oggetti SQL Server"
        oStep.CommitSuccess = False
        oStep.RollbackFailure = False
        oStep.ScriptLanguage = "VBScript"
        oStep.AddGlobalVariables = True
        oStep.RelativePriority = 3
        oStep.CloseConnection = False
        oStep.ExecuteInMainThread = False
        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 Copia oggetti SQL Server (Copia
oggetti SQL Server)
Call Task_Sub1(goPackage)
'---------------------------------------------------------------------------
' Save or execute package
'---------------------------------------------------------------------------
'goPackage.SaveToSQLServer "(local)", "sa", ""
goPackage.Execute
goPackage.Uninitialize
'to save a package instead of executing it, comment out the executing
package line above and uncomment the saving package line
Set goPackage = Nothing
Set goPackageOld = Nothing
End Sub
'------------- define Task_Sub1 for task Copia oggetti SQL Server (Copia
oggetti SQL Server)
Public Sub Task_Sub1(ByVal goPackage As Object)
Dim oTask As DTS.Task
Dim oLookup As DTS.Lookup
Dim oCustomTask1 As DTS.TransferObjectsTask2
Set oTask = goPackage.Tasks.New("DTSTransferObjectsTask")
Set oCustomTask1 = oTask.CustomTask
        oCustomTask1.Name = "Copia oggetti SQL Server"
        oCustomTask1.Description = "Copia oggetti SQL Server"
        oCustomTask1.SourceServer = "ACER-CARLO"
        oCustomTask1.SourceLogin = "sa"
        oCustomTask1.SourceUseTrustedConnection = False
        oCustomTask1.SourceDatabase = "DIAMANTE"
        oCustomTask1.DestinationServer = "ACER-VALERII"
        oCustomTask1.DestinationLogin = "sa"
        oCustomTask1.DestinationUseTrustedConnection = False
        oCustomTask1.DestinationDatabase = "DIAMANTE"
        oCustomTask1.ScriptFileDirectory = "C:\Programmi\Microsoft SQL
Server\80\Tools"
        oCustomTask1.CopyAllObjects = False
        oCustomTask1.IncludeDependencies = True
        oCustomTask1.IncludeLogins = False
        oCustomTask1.IncludeUsers = True
        oCustomTask1.DropDestinationObjectsFirst = True
        oCustomTask1.CopySchema = True
        oCustomTask1.CopyData = 0
        oCustomTask1.ScriptOption = -
2147061505
        oCustomTask1.ScriptOptionEx = 4112
        oCustomTask1.SourceTranslateChar = True
        oCustomTask1.DestTranslateChar = True
        oCustomTask1.DestUseTransaction = False
        oCustomTask1.UseCollation = False
        oCustomTask1.AddObjectForTransfer "Bilancio Contabile", "dbo", 4
        oCustomTask1.AddObjectForTransfer "BOLLE_DA_FATTURARE", "dbo", 4
        oCustomTask1.AddObjectForTransfer "DATI_FORM", "dbo", 4
        oCustomTask1.AddObjectForTransfer "DETTAGLIO_PNOTE", "dbo", 4
        oCustomTask1.AddObjectForTransfer "Dipendenti in Forza", "dbo", 4
        oCustomTask1.AddObjectForTransfer "Dipendenti per Cantiere", "dbo",
4
        oCustomTask1.AddObjectForTransfer "GG_ALTRE_DIPENDENTE", "dbo", 4
        oCustomTask1.AddObjectForTransfer "GG_ASSENZE_DIPENDETE", "dbo", 4
        oCustomTask1.AddObjectForTransfer "GG_CIG_DIPENDENTE", "dbo", 4
        oCustomTask1.AddObjectForTransfer "GG_CIGS_DIPENDENTE", "dbo", 4
        oCustomTask1.AddObjectForTransfer "GG_FERIE_DIPENDENTE", "dbo", 4
        oCustomTask1.AddObjectForTransfer "GG_INFORTUNIO_DIPENDENTE", "dbo",
4
        oCustomTask1.AddObjectForTransfer "GG_MALATTIA_DIPENDENTE", "dbo", 4
        oCustomTask1.AddObjectForTransfer "IMPONIBILE_REGISTRO_IVA", "dbo",
4
        oCustomTask1.AddObjectForTransfer "IMPOSTA_REGISTRO_IVA", "dbo", 4
        oCustomTask1.AddObjectForTransfer "Lista_At_Anagr", "dbo", 4
        oCustomTask1.AddObjectForTransfer "Lista_Banche", "dbo", 4
        oCustomTask1.AddObjectForTransfer "Lista_Cantieri", "dbo", 4
        oCustomTask1.AddObjectForTransfer "Lista_Clienti", "dbo", 4
        oCustomTask1.AddObjectForTransfer "Lista_Committenti", "dbo", 4
        oCustomTask1.AddObjectForTransfer "Lista_Comuni", "dbo", 4
        oCustomTask1.AddObjectForTransfer "Lista_Cs_Assic", "dbo", 4
        oCustomTask1.AddObjectForTransfer "Lista_Cs_Categ", "dbo", 4
        oCustomTask1.AddObjectForTransfer "Lista_CS_Causa", "dbo", 4
        oCustomTask1.AddObjectForTransfer "Lista_Cs_Mezzi", "dbo", 4
        oCustomTask1.AddObjectForTransfer "Lista_Dipendenti", "dbo", 4
        oCustomTask1.AddObjectForTransfer "Lista_Fornitori", "dbo", 4
        oCustomTask1.AddObjectForTransfer "Lista_Gsartimp", "dbo", 4
        oCustomTask1.AddObjectForTransfer "Lista_GsCenCos", "dbo", 4
        oCustomTask1.AddObjectForTransfer "Lista_Gscencos1", "dbo", 4
        oCustomTask1.AddObjectForTransfer "Lista_GsEnteap", "dbo", 4
        oCustomTask1.AddObjectForTransfer "Lista_Iva", "dbo", 4
        oCustomTask1.AddObjectForTransfer "Lista_Iva_CG", "dbo", 4
        oCustomTask1.AddObjectForTransfer "Lista_Lettere_Accompagnatorie",
"dbo", 4
        oCustomTask1.AddObjectForTransfer "Lista_Magazzini", "dbo", 4
        oCustomTask1.AddObjectForTransfer "Lista_OL", "dbo", 4
        oCustomTask1.AddObjectForTransfer "Lista_OL_Cantiere_Ente", "dbo", 4
        oCustomTask1.AddObjectForTransfer "Lista_OL_CentriCosto", "dbo", 4
        oCustomTask1.AddObjectForTransfer "Lista_OrdiniFornitoreEuro",
"dbo", 4
        oCustomTask1.AddObjectForTransfer "Lista_OrdiniFornitoreLire",
"dbo", 4
        oCustomTask1.AddObjectForTransfer "Lista_Pagamenti", "dbo", 4
        oCustomTask1.AddObjectForTransfer "Lista_Prestazi", "dbo", 4
        oCustomTask1.AddObjectForTransfer "Lista_Squadre", "dbo", 4
        oCustomTask1.AddObjectForTransfer "Lista_Terzisti", "dbo", 4
        oCustomTask1.AddObjectForTransfer "Lista_Tipologie", "dbo", 4
        oCustomTask1.AddObjectForTransfer "Movimenti_per_Causale_Mese",
"dbo", 4
        oCustomTask1.AddObjectForTransfer "RIEP_REG_IVA_GEN", "dbo", 4
        oCustomTask1.AddObjectForTransfer "STAMPA PNOTE CDC", "dbo", 4
        oCustomTask1.AddObjectForTransfer "Stampa_Anag_Dip", "dbo", 4
        oCustomTask1.AddObjectForTransfer "Stampa_Assenze_per_Causale",
"dbo", 4
        oCustomTask1.AddObjectForTransfer "Stampa_Clienti_Riep", "dbo", 4
        oCustomTask1.AddObjectForTransfer "STAMPA_FATT_FINALI", "dbo", 4
        oCustomTask1.AddObjectForTransfer "Stampa_Fornitori_Riep", "dbo", 4
        oCustomTask1.AddObjectForTransfer "Stampa_Movimenti_Causale", "dbo",
4
        oCustomTask1.AddObjectForTransfer
"Stampa_Prelievi_Materiali_Consumo", "dbo", 4
        oCustomTask1.AddObjectForTransfer
"Stampa_Prelievi_Materiali_Diretti", "dbo", 4
        oCustomTask1.AddObjectForTransfer "STAMPA_PROVA", "dbo", 4
        oCustomTask1.AddObjectForTransfer "Stampa_Sal_fat_Fisc", "dbo", 4
        oCustomTask1.AddObjectForTransfer "STAMPA_SCADENZARIO", "dbo", 4
        oCustomTask1.AddObjectForTransfer "Stampa_Terzista_Benestarato",
"dbo", 4
        oCustomTask1.AddObjectForTransfer "Terz_Materiali_Testata", "dbo", 4
        oCustomTask1.AddObjectForTransfer "Terz_Produzione_Testata", "dbo",
4
        oCustomTask1.AddObjectForTransfer "VIEW1", "dbo", 4
        oCustomTask1.AddObjectForTransfer "Vista_Produzione", "dbo", 4
goPackage.Tasks.Add oTask
Set oCustomTask1 = Nothing
Set oTask = Nothing
End Sub

 ha scritto nel
messaggio news:abg5s8$l5m$1...@newsreader.mailgate.org...
