Hello, I have created a job which I pass two variables through as follows:
DTSRUN
/Sqh-sql2
/N"UnisoftVB"
/AgvAccessDatabase :8="Y:\InformationCopy.mdb"
/AgvAccessForm :8= "frmImportDataBackup"
/E
The "UnisoftVB" DTS contains the following ActiveX script:
'**********************************************************************
' Visual Basic ActiveX Script
'************************************************************************
Dim varAccessDatabase
Dim varAccessForm
Function PressButton()
varAccessDatabase = DTSGlobalVariables ("gvAccessDatabase").Value
varAccessForm = DTSGlobalVariables ("gvAccessForm").Value
Dim objDB
Set objDB = CreateObject("Access.Application")
objDB.OpenCurrentDatabase(varAccessDatabase)
objDB.OpenForm(varAccessForm)
objDB.CloseCurrentDatabase
objDB.Quit
PressButton = DTSTaskExecResult_Success
End Function
The form in the access database when opened runs a lot of VB (which I didn't write) and ultimately updates a table with up to the most recent data.
When I run the job it is successful but it happens far too quickly which made me suspicious that it wasn't working. The table doesn't contain the most up to date data.
I have checked my DTS by chaning the global variables and declaring them there instead and it does work.
I wondered if anyone could tell me why my Job doesn't seem to run my DTS correctly????
Please help Jo