AR 15 and MySql with parameters

Posted by: info on 22 February 2021, 7:54 am EST

    • Post Options:
    • Link

    Posted 22 February 2021, 7:54 am EST

    Hello,

    i´m using AR 15 with mysql database connected through Microsoft ODBC.

    The datasource is a text-query like

    select * from vw_hsfrequestreport where Createdate >= @Startdate

    where the reportparameter Startdate is from type date.

    when i start the report there is no result displayed. when i look at odbc-log there is the line

    select * from vw_hsfrequestreport where Createdate >= @Startdate;

    logged.

    it seems that @Startdate is not replaced by the parameter-value.

    can you help me? Attached you find the sample report

    best regards

    volkhard

    HsfRequests.zip

  • Posted 22 February 2021, 11:55 pm EST - Updated 30 September 2022, 6:27 am EST

    Hello,

    You need to map the dataset parameter with the report parameter as shown in attached image. Also, refer to the modified report.

    Thanks,

    Mohit

    HsfRequests_Mod.zip

  • Posted 23 February 2021, 5:27 pm EST

    Hello Mohit,

    thanks for your idea. i tried this but it doesn´t work (also in your modified sample). The report shows no result and the the ODBC-Log still gives the line

    :select * from vw_hsfrequestreport where Createdate >= @Startdate;

    do you have an idea?

    best regards

    Volkhard

  • Posted 23 February 2021, 6:25 pm EST

    Hello,

    Can you please try with the following query in my modified report:

    select * from vw_hsfrequestreport where Createdate >= ?

    Please refer to the following link also:

    https://docs.microsoft.com/en-us/sql/odbc/reference/develop-app/binding-parameters-odbc?view=sql-server-ver15

    Thanks,

    Mohit

  • Posted 23 February 2021, 6:44 pm EST

    Hello Mohit,

    thanks - this works :).

    In the documentation this way of parameter-referencing is stated for oledb-connections - but i do have an odbc-connection. do you know why there is this difference?

    best regards

    Volkhard

  • Posted 23 February 2021, 11:19 pm EST

    Hello,

    There is nothing to do with AR. There are different way of mentioning parameter in different provider. You can refer to the following link for more detail about parameter in ODBC with SQL:

    https://docs.microsoft.com/en-us/sql/odbc/reference/develop-app/binding-parameters-odbc?view=sql-server-ver15

    Thanks,

    Mohit

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels