Active Query Builder support area

How do I save the current SQL statement as is so it can be loaded again and amended? (ActiveX Edition)

Avatar
  • updated
  • Completed

Hi I am a new to developing with your activeX component

How do I save the current tables/select statement as is so it can be loaded again and amended ?

I tried SaveToXMLFile but this does not seem to do anything

Also this and many other methods exposed by the activex do not appear to be in the help file which only seem to contain a tiny fraction of them ?

Thanks

Avatar
Andrey Zavyalov, PM

Hello,

To load SQL query back to the component you can simply assign it's text to the ActiveQueryBuilderX.SQL property. Also if you want to save and load the layout of tables within the Design Area among with SQL text, you can read and write the ActiveQueryBuilderX.LayoutSQL property.

If you want to syncronize Active Query Builder with the SQL text editor, Use the ActiveQueryBuilderX.SQLUpdated event to get new SQL query text each time when the query is updated in Active Query Builder visually. In the text editor, assign the text from the editor to the ActiveQueryBuilderX.SQL property on exiting from the SQL text editor, but handle the exceptions, as the end-user may write incorrect SQL text, so Active Query Builder wouldn't be able to parse it.


Avatar
Andrey Zavyalov, PM

I am sorry for the lack of documentation for the ActiveX version, but there is some other information apart from the property reference. You can review the introductionary knowledge book, the chapter about metadata loading, and review the demo projects that included in the installation package. Of course, you feel free to contact us with any questions you may have.

Avatar
Andrew Kennard

Thanks I shall look into that.

I'm a bit stuck on writing a wrapper class when it comes to how te various activeX objects link together

I've worked out that I can call CreateCOMObject in Dataflex for the meta data container and that seems to work

This does not work for TreeOptions. For that I get the TreeOptions variant property of the main object and assign it to the pvCOMObject property of the TreeOptions object and I can then set the TreeColor property etc

Which property do I need to get to set the pvCOMobject of the SelectFormat object. It's not obvious which of the main object properties it might be ? SQLFormatMain SQLFormatFrom SQLFormatExpression ? or is it all three ?

Thanks

Avatar
Andrey Zavyalov, PM

Hi,

They all (including the non-mentioned SQLFormatCTE) determine formatting of different parts of SQL query:

SQLFormatMain - formatting of the main query,

SQLFormatFrom - formatting of sub-queries in the FROM clause (derived tables),

SQLFormatExpression - formatting of sub-queries used in SQL expressions in different parts of the query

SQLFormatCTE - formatting of Common Table Expressions (subqueries in the WITH section prior to main query).

If you don't want to make any distinctions between these types, you can set formatting properties for the main query and then assign them to the rest of them.

Avatar
Andrew Kennard

OK I have changes some of these values and am seeing an effect on FormattedSQL so i'm happy I should be able to set these OK when the time comes