Hi Horst,
Attached below is some sample code that should work, it does not change the
table
but the select statement, you should be able to change it. It relies on a
GlobalVariable
as a controller and an activex script task which is on sucess from the pump.
-Euan
Function Main()
If DTSGlobalVariables("LoopController").Value = False then
DTSGlobalVariables("LoopController").Value =True
ResetConnection
end if
Main = DTSTaskExecResult_Success
End Function
Private Sub ResetConnection
Dim oPackage
Dim oPump
set oPackage = DTSGlobalVariables.Parent
set oPump = oPackage.Tasks("BuildMini_Task").CustomTask
oPump.SourceSQLStatement = "SELECT City, Region, Country FROM Customers"
oPackage.Steps("BuildMini_Task_Step").ExecutionStatus =
DTSStepExecStat_Waiting
End Sub
Quote:> Hello!
> I have a (unknown) list of dBase-Files in a known directory. All these
> files have the same structure and I have to merge all the data in one
> SQL table.
> I succeeded in establishing a loop through all the dbf-files and for
> testing I pop up a message box which displays the actual filename.
> And here is my problem: inside the data pump (no query, just copying)
> I have to set the tablename to the name of the file. How can I set the
> table name via an active script task?
> Thank you in advance
> Horst Gassner
> SkiData AG Austria
> http://www.skidata.com