TfrxAdoQuery: columns are lost after execute

edited 2:25AM in FastReport 4.0
Hi,

we need to execute ADO Stored procedures. FastReport doens't have that component (yet [img]style_emoticons/<#EMO_DIR#>/wink.gif" style="vertical-align:middle" emoid=";)" border="0" alt="wink.gif" />), but we can use TfrxAdoQuery. SQL code is simple:[/img]
EXEC dbo.StoredProcName @param1 = :param1, @param2 = :param2

It is working. I fill Parameters and after confirming SQL is query executed. I got fields and all is fine. But - after executing report (from Design time) is another refresh called. And - that is trouble - stored parameters are not used. Report designer just send NULL's to all parameters. And if stored procedure needs that data then returns nothing. And when FastReport see it then immediately delete Query columns.

I must go to TfrxAdoQuery.SQL - open editor - and press SAVE/Execute again to bring columns back.

TfrxAdoQuery should use parameters values instead NULL during calling refresh.

Comments

  • gordkgordk St.Catherines On. Canada.
    edited 2:25AM
    questions
    where is code located and in what event
    does this only happen when running from ide or at runtime as well?
  • edited 2:25AM
    Designer is running from Delphi, in design time. Parameters are set by hand directly in TfrxAdoQuery component (with test values).

    Sample Stored procedure:
    CREATE PROCEDURE frx_TestProcedure_PRINT (@dbname VARCHAR(256))
    AS
    IF @dbname IS NULL
    BEGIN
      PRINT 'You must specify Database name...'
      RETURN
    END
    SELECT name, dbid, filename FROM master.dbo.sysdatabases WHERE name = @dbname
    

    In report:

    TfrxAdoQuery.SQL: EXEC frx_TestProcedure_PRINT @dbname = :ProcedureName
  • ArroriumtutArroriumtut Saudi Arabia
    edited 2:25AM
    to: Admin - If You want to delete your site from my spam list, please sent url of your domain to my e-mail: stop.spam.today@gmail.com
    And I will remove your site from my base within 24 hours
    webmastegz

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.