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

Completely Hide SQL

edited July 2003 in End User
Is there a simple way (short of building and registering a new Query
Designer dialog) to completely hide the SQL tab and field/table SQL aliases?
I can turn off the ability to edit the SQL ok, but we don't want our users
to see the actual SQL field and table names.

Jim

Comments

  • edited July 2003
    You can control this by registering a descendent dataview class. Here is an
    example of removing the Calc tab. Try removing ppemText from the example to
    remove the SQL tab.

    http://www.digital-metaphors.com/tips/NoCalcDV.zip


    Cheers,

    Jim Bennett
    Digital Metaphors


  • edited July 2003
    Thanks, this was a good start, but I ran into a couple of problems. First,
    the SQL item on the context menu for a "floating dataview" is gone, that's
    good, but the SQL tab on the Query Designer dialog is still there. Second,
    with the ppemText removed, adding two or more tables that are pre-joined in
    the Dictionary (manual join is off) using the Query Wizard or the Query
    Designer causes an access violation in TdaSQL.BuildSQL89JoinExpression where
    it references lTableJoin.LocalField.SQLString (LocalField was nil). This
    happens whether I use SQL1 (89) or SQL2 (92). I am using RB 6.03 Pro, D6
    Enterprise sp2, NativeDB and NativeDB's dataview classes from their web
    page. I did change NoCalcDV's register and un-register calls to reference
    TdaNDBQueryDataView. Maybe the bugs are in that class? If so, could you
    clue me in to where to look?

    Jim


  • edited July 2003
    Yes, that is right. The edit options are controlling what can be edited, not
    what is shown. The actual SQL tab is hard coded to be created. You'll have
    to replace the query deisgner form. The line of code to remove in the custom
    form class is the procedure TdaQueryDesignerForm.Initialize on the line

    //comment this out FPages.Add(TdaSQLPage.CreatePage(Self,
    pgcDesigner));

    Here is an example of replacing the query tools:
    http://www.digital-metaphors.com/tips/ReplaceQueryTools.zip



    Cheers,

    Jim Bennett
    Digital Metaphors


  • edited July 2003
    Thanks! I've got the new form registered and it does not show the SQL tab.
    I've also successfully removed the columns showing the SQL table and field
    names. Now I noticed that right clicking or clicking the toolbar buttons in
    a dataview don't display the Query Designer. It has this problem in the
    ReplaceQueryTools example code as well. It looks like a problem getting the
    classname back from TdaQueryDataView.DataDesignerClass. As a guess I
    overrode this function in TdaNDBQueryDataView to return the right class name
    but that didn't work. Any other ideas?

    Jim

  • edited July 2003
    Aha, I had the wrong class name in the override code. That works now, but
    it feels like the wrong solution. Could you still respond to this?

    Jim


  • edited July 2003
    That should do the trick. Any other problems now that it is working?


    Cheers,

    Jim Bennett
    Digital Metaphors


  • edited July 2003
    In removing the code that added the SQL table and field name columns, I
    sometimes get an index out of bounds error. I think I've caught all the
    references to columns, but there must still be one that is wrong. As always
    happens, I'm putting out some other fires for a few days, but I'll get back
    to this soon.

    Jim


This discussion has been closed.