Question MSDE: Query Analyzer vs MSAccess ADP

  • Hi all!

    I have one UDF which take 5 params. When I run this UDF from Query Analyzer, it take 5 seconds, but when I run from ADP project (doble click), it take > 200 seconds. I look at the connexion, seems ok (File -> Connexion; in .adp).

    Can anybody tell me why are this differences?

    Thank's in advance

    koci.

  • Ok, partially I solved the problem, but still have a question:

    The difference between this two tools:

    1. In QA: select * from CInventarioAFechaPaso7Agrupar ('01/01/06',1,10000,0,0,0)

    2. In ADP: Report.ControlSource = CInventarioAFechaPaso7Agrupar

      Report.InputParameters = @FechaInventario datetime = Forms!PIInventario!FechaInventario, @DesdeFabricante int = Forms!PIInventario!DesdeProveedor, @HastaFabricante int = Forms!PIInventario!HastaProveedor, @IDFamilia smallint = Forms!PIInventario!IDFamilia, @IDMarca smallint = Forms!PIInventario!IDMarca, @IDTienda smallint = Forms!PIInventario!IDTienda

    When I change the reports control source at:

    select * from CInventarioAFechaPaso7Agrupar ('01/01/06',1,10000,0,0,0)

    and clean InputParameters, everything works OK, like in QA (of the time point of view, of course), so, no difference.

    So far, so good.

    But if I want to put params in the reports control source, like:

    SELECT * FROM CInventarioAFechaPaso7Agrupar(@FechaInventario, @DesdeFabricante, @HastaFabricante, @IDFamilia, @IDMarca, @IDTienda)

    the InputParameters it's change in:

    ?  = FechaInventario, ?  = DesdeFabricante, ?  = HastaFabricante, ?  = IDFamilia, ?  = IDMarca, ?  = IDTienda

    And If I edit this line, changing in:

    @FechaInventario datetime = Forms!PIInventario!FechaInventario, @DesdeFabricante int = Forms!PIInventario!DesdeProveedor, @HastaFabricante int = Forms!PIInventario!HastaProveedor, @IDFamilia smallint = Forms!PIInventario!IDFamilia, @IDMarca smallint = Forms!PIInventario!IDMarca, @IDTienda smallint = Forms!PIInventario!IDTienda

    the line is change back in:

    ?  = FechaInventario, ?  = DesdeFabricante, ?  = HastaFabricante, ?  = IDFamilia, ?  = IDMarca, ?  = IDTienda

    and I have no way to avoid the manual introduction of params, to run the report.

    Any explications for this? A workaround, something?

    Thank's,

    koci.

    PS. The way that I use (and work) is assigning in code, in the reports open event, something like following:

    Dim MiSQL As String

        MiSQL = "select * from CInventarioAFechaPaso7Agrupar ('" & Forms!PIInventario!FechaInventario & "'," & _

        Forms!PIInventario!DesdeProveedor & "," & Forms!PIInventario!HastaProveedor & "," & _

        Forms!PIInventario!IDFamilia & "," & Forms!PIInventario!IDMarca & "," & Forms!PIInventario!IDTienda & ")"

        Debug.Print MiSQL

        Me.RecordSource = MiSQL

    but this is not very elegant, because can't see the field list, for an quick development of report.

    .

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

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