Own version of usysidx.frm

Author: anne_vw@telenet.be (anne_vw)

We have one uniface application with a lot of users.  The connection to the database differs from user to user.  Every user makes a connection, to the for him available database path with his own username and password.  To do this we made a other version of the usysidx.frm. 

 

When a user makes first access to the database our version of usysidx.frm is called to open the connection.  This happens in background. 

When the connection goes wrong the usysidx.frm is called over and over again so we become an endless loop. 

Does anybody know how we can stop this loop?  I can check if the form usysidx.frm is called again and quit the application via the apexit but this is not what I want.  I want to give a message to the user that the connection failed but the user need to stays in the application.

 

I tried to give back different negative status id’s but the application keeps looping the usysidx.frm.

6 Comments

  1. Hi Anne,

     

    I think the problem is in the nature of the application itself (plus the uniface runtime machine which controls the open).

     

    As long as a database connection is not open, uniface will try to open it whenever it wants to access this database path
    and shows this dialog as the consequence over and over again (but this is not looping on the same position of code).
    You may control this using the stack information.

    OK, because it is your own version of component,
    you may integrate the message in the componenet itself,
    add a repetition counter which stops the display of the component repeatedly, ...

    Perhaps you can help me: when the connection to the database fails, what is the use to stay in the application?


    Author: ulrich-merkel (ulrichmerkel@web.de)
  2. Hi Ulrich,

     

    thank you for your reply.

    That is the problem how can we stop displaying the component without leaving the application?

    We want to stay in the application because it is possible the user wants to perform some other actions on components that connect to another database path.

     

    Best regards

    Anne


    Author: anne_vw (anne_vw@telenet.be)
  3. ... in the EXEC trigger, just bypass the edit/display command:

    if (is_multiple_called)
       return(0)
    endif

     

    You have to provide a mean to reset the is_multiple_called
    if you want to give your user a chance to access another database path.

     

    OR:

    in the initialisation of your application,
    just place an explicit open to your database path.

    This will in turn call up the index form (only once)
    evaluate the $status of the open statement

    If it failed, just block the part of your application which deals with this database.



    Author: ulrich-merkel (ulrichmerkel@web.de)
  4. Hi,

    Thank you for the replay.

    In de form is not edit or display.  It is an other version of USYSIDX.frm.

     

    The second solution is no option either because it depend from user to user if they have access or not.

     

    But we found a solution:

    When we try to make the connetiona second time we give up an empty db where every user has accesss to.  We have then a successfull connection so the component is not activated again.  Then the read fails because of table not found.

    It works for the read, i have to check if it also works with a store because uniface makes tables on the fly.

     

    best regards

    Anne

     


    Author: anne_vw (anne_vw@telenet.be)
  5. Hi Anne,
    Can you please provide trx or export file for your usysidx.frm , in case possible will try modifying it and provide code


    Author: lalitpct (lalitpct@gmail.com)
  6. Hi,

     

    thanks for your help.

    We found a kind of solution (see reply to Ulrich_Merkel)

    But i send the export file to your g-mail.  A better solution would be great. 

     

    Best regards

    Anne


    Author: anne_vw (anne_vw@telenet.be)