VB Script syntax error in DTS...

  • Hi all!! I'm new to these forums 🙂

    I'm trying to program a DTS package, in particular a Data Driven Query. I get the syntax error like "Parenthesis ')' expected", but I can't find any error in the following code. Can you help me? Many thanks in advantage!!!

    '**********************************************************************

    ' Visual Basic Transformation Script

    '************************************************************************

    ' Copy each source column to the destination column

    Function Main()

    DTSGlobalVariables("DataOra").Value = getdate()

    q = DTSLookups("FiltroStoricoIdLotto_Lookup")._

    Execute(DTSSource("Id"), DTSSource("Lotto"))

    If Not IsEmpty(q) Then

    If (q[3] <> DTSSource("Magazzino") Or q[4] <> DTSSource("Posizione") Or q[5] <> DTSSource("NumColli") Or q[6] <> DTSSource("StatoQualita")) Then

    DTSDestination("IdContainer") = DTSSource("Id")

    DTSDestination("Magazzino") = DTSSource("Magazzino")

    DTSDestination("Posizione") = DTSSource("Posizione")

    DTSDestination("Articolo") = DTSSource("Articolo")

    DTSDestination("Lotto") = DTSSource("Lotto")

    DTSDestination("NumColli") = DTSSource("NumColli")

    DTSDestination("StatoQualita") = DTSSource("StatoQualita")

    DTSDestination("DataOraIn") = DTSGlobalVariables("DataOra").Value

    DTSDestination("DataOraOut") = DTSGlobalVariables("DataOra").Value

    End If

    Else

    DTSDestination("IdContainer") = DTSSource("Id")

    DTSDestination("Magazzino") = DTSSource("Magazzino")

    DTSDestination("Posizione") = DTSSource("Posizione")

    DTSDestination("Articolo") = DTSSource("Articolo")

    DTSDestination("Lotto") = DTSSource("Lotto")

    DTSDestination("NumColli") = DTSSource("NumColli")

    DTSDestination("StatoQualita") = DTSSource("StatoQualita")

    DTSDestination("DataOraIn") = DTSGlobalVariables("DataOra").Value

    DTSDestination("DataOraOut") = DTSGlobalVariables("DataOra").Value

    End If

    End Function

  • I think it's complaining about the line continuation character actually.

    try

    q = DTSLookups("FiltroStoricoIdLotto_Lookup").Execute(DTSSource("Id"), DTSSource("Lotto"))

    instead of

    q = DTSLookups("FiltroStoricoIdLotto_Lookup")._

    Execute(DTSSource("Id"), DTSSource("Lotto"))


    In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.   Douglas Adams (1952-2001)

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply