Error on TdaSQLBuilder.ApplyUpdates. Event Question
Hello.
Working from within the Report Designer, I get an - "Expected '(' or '[',
but found 'ApplyUpdates' instead" compiliation error, even though I'm using
Ver. 10.02.
Trying to rely on the Free method of TdaSQLBuilder has led me to believe
that the event I was using (BeforeOpenDataPipelines) is not being triggered.
For some reason, not creating an instance for the SQLBuilder and than
calling its methods, or assigning nil to the report's DBPipeline doesn't
raise an exception.
Best Regards,
Omer Shaked
Working from within the Report Designer, I get an - "Expected '(' or '[',
but found 'ApplyUpdates' instead" compiliation error, even though I'm using
Ver. 10.02.
Trying to rely on the Free method of TdaSQLBuilder has led me to believe
that the event I was using (BeforeOpenDataPipelines) is not being triggered.
For some reason, not creating an instance for the SQLBuilder and than
calling its methods, or assigning nil to the report's DBPipeline doesn't
raise an exception.
Best Regards,
Omer Shaked
This discussion has been closed.
Comments
- As a test, try implementing the same event-handler via Delphi code and add
the call to ApplyUpdates. Ttrace the event in the Delphi debugger and verify
that it is working. Then comment out the ApplyUpdates method and test
whether it still works.
- To determine whether an event-handler is being fired, add a call to
MessageBeep or ShowMessage. Or use a logging tool such as CodeSite.
- Usually it is not necessary to call ApplyUpdates, it will be called
automatically. I created a patch for RB 10.04 that adds support for calling
TdaSQLBuilder.ApplyUpdates from RAP code. Registered users of RB 10.04 can
email support@digital-metaphors.com to request the patch.
- To update from RB 10.02 to RB 10.04, send your serial number and
registration information to info@digital-metaphors.com and request it.
--
Nard Moseley
Digital Metaphors
www.digital-metaphors.com
Best regards,
Nard Moseley
Digital Metaphors
www.digital-metaphors.com
occuring in ver. 10.04. Could it be due to improper removal of previous
versions ?
As you can see, I've attempted to add a selected field in the following
manner :
lSQLBuilder.SelectFields.Add('', '''1'' AS FUNC_FLD');
But it produced no changes in the dataset and in the
lSQLBuilder.SelectFields.Count property.
What's the proper way to add a field in this manner ? What I'm trying to
achieve is a stored (Sql-Server)function that will be called with AutoSearch
derived parameters and have its value in a specific field that will appear
in the report.
Omer Shaked
- perhaps a miscommunication. The sentence "I created a patch for RB
10.04..." means that registered users of RB 10.04 can email
support@digital-metaphors.com and request a patch. (If RB 10.04 included
support for calling ApplyUpdates from RAP, then there would not be the need
for a patch).
- as an incremental step, how would you use the Query Designer to implement
a solution?
- TdaSQLBuilder is organized like the QueryDesigner's tabs. Like the
QueryDesigner, the SelectFields can only include fields from a database
table. The SearchCriteria can contain fields that are used to generate the
SQL Where clause (SearchCriteria can be either static or can be designated
as AutoSearch). CalcFields can contain calculated fields, etc.
- For detailed information about TdaSQLBuilder, check out the RBuilder.hlp
topic for TdaSQLBuilder and then traverse to its properties and methods.
There are code examples included in some of the help topics.
I am not clear on what you are trying to accomplish - what is the goal.
Sounds like you want to display an autosearch dialog to the user and then
the user will enter a value. What is the value? And what type of calculation
do you need to perform on the value? And why not do the calculation in RAP
or Delphi code, why call the SQL Server? The results of the calculation are
then to be used in the SQL Where clause?
--
Nard Moseley
Digital Metaphors
www.digital-metaphors.com
Best regards,
Nard Moseley
Digital Metaphors
www.digital-metaphors.com