Necesito ayuda en codigo activex
Publicado por Carolisss (1 intervención) el 17/11/2009 15:29:23
Estimados, llevo poco tiempo trabajando con DTS y se me ha pedido arreglar uno que falla en las variables Globales se su código activeX.
envío código para que me puedan ayudar.
saludos
'**********************************************************************
' Secuencia de comandos ActiveX Visual Basic
'************************************************************************
' Copy File
'Option Explicit
Function Main()
Dim oFSO
Dim sSourceFile
Dim sDestinationFile
Set oFSO = CreateObject("Scripting.FileSystemObject")
set sSourceFile = DTSGlobalVariables("DirectorioOrigen").Value & DTSGlobalVariables("IdProCentro").Value & "_" & DTSGlobalVariables("IdProceso").Value & ".mdb"
'sSourceFile = DTSGlobalVariables("DirectorioOrigen").Value & "3510_738.mdb"
set sDestinationFile = DTSGlobalVariables("DirectorioDestino").Value & DTSGlobalVariables("NombreDestino").Value
' Check if file exists to prevent error
If oFSO.FileExists(sDestinationFile) Then
oFSO.DeleteFile sDestinationFile
End If
oFSO.CopyFile sSourceFile, sDestinationFile
'oFSO.DeleteFile sSourceFile
' Clean Up
Set oFSO = Nothing
Main = DTSTaskExecResult_Success
End Function
Function QualifyPath(ByVal sPath)
If Right(sPath, 1) = "\" Then
QualifyPath = sPath
Else
QualifyPath = sPath & "\"
End If
End Function
envío código para que me puedan ayudar.
saludos
'**********************************************************************
' Secuencia de comandos ActiveX Visual Basic
'************************************************************************
' Copy File
'Option Explicit
Function Main()
Dim oFSO
Dim sSourceFile
Dim sDestinationFile
Set oFSO = CreateObject("Scripting.FileSystemObject")
set sSourceFile = DTSGlobalVariables("DirectorioOrigen").Value & DTSGlobalVariables("IdProCentro").Value & "_" & DTSGlobalVariables("IdProceso").Value & ".mdb"
'sSourceFile = DTSGlobalVariables("DirectorioOrigen").Value & "3510_738.mdb"
set sDestinationFile = DTSGlobalVariables("DirectorioDestino").Value & DTSGlobalVariables("NombreDestino").Value
' Check if file exists to prevent error
If oFSO.FileExists(sDestinationFile) Then
oFSO.DeleteFile sDestinationFile
End If
oFSO.CopyFile sSourceFile, sDestinationFile
'oFSO.DeleteFile sSourceFile
' Clean Up
Set oFSO = Nothing
Main = DTSTaskExecResult_Success
End Function
Function QualifyPath(ByVal sPath)
If Right(sPath, 1) = "\" Then
QualifyPath = sPath
Else
QualifyPath = sPath & "\"
End If
End Function
Valora esta pregunta


0