Home Server
New Blog Posts: Merging Reports - Part 1 and Part 2

ADOConnection component name

edited June 2013 in Server
Using RB9.02 with an ADOConnection component called 'adoSterilizing', I
have some reports saved in a database table (rb_item). Here is a snippet
from a 'Save to file' of such a report:
object system_information: TppChildDBPipeline
AutoCreateFields = False
UserName = 'system_information'
object ppField1: TppField
FieldAlias = 'company'
FieldName = 'company'
FieldLength = 10
DisplayWidth = 10
Position = 0
TableName = 'settings'
end
end
object daSQL1: TdaSQL
GuidCollationType = gcMSSQLServer
DatabaseName = 'adoSterilizing'
DatabaseType = dtMSSQLServer
DataPipelineName = 'system_information'
LinkColor = clMaroon
MaxSQLFieldAliasLength = 25
SQLText.Strings = (
'SELECT settings.company'
'FROM settings settings')
SQLType = sqSQL1

If I try to open/run any such report with a differently named
ADOConnection component (e.g. 'adoDB'), RB complians that adoSterilizing
can't be found.
Does this mean that if I upgrade to RBServer, I have to replace all
references to 'adoSterilizing' with the appropriate name or have to use
the same component name (adoSterilizing)?

Thanks,

Arthur


Comments

  • edited June 2013
    RB Server Edition uses the same report loading logic that is built into the
    other RB Editions. If you try renaming your ADOConnection object in your
    standard RB app, you will get an error as well.

    The DatabaseName is saved as part of the report definition. Simplest
    solution is to use the same ADOConnection.Name for the ReportVolume module.
    That is how we created our demos.

    As an Alternative you can implement the ReportVolume.OnLoadReportEnd event
    to update the report SQL when the report is loaded.

    Here is a simple example (I did not compile this)

    uses
    daSQLBuilder;

    begin

    lSQLBuilder := TdaSQLBuilder.Create(myReport.DataPipeline);

    lSQLBuilder.SQL.DatabaseName := myADOConnection.Name;

    lSQLBuilder.ApplyUpdates;

    lSQLBuilder.Free;


    end;

    -
    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com

    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
This discussion has been closed.