Jump to content

mierlp

uniGUI Subscriber
  • Posts

    572
  • Joined

  • Last visited

  • Days Won

    35

Posts posted by mierlp

  1. That's right .. that doesn't work, but that has to do with the fact that loading the database and executing the code may be too fast.

    In addition, it is never a good idea to put Queries and Datasets on the form, that's exactly what the DataModule are for.

    I would choose a different setup. Try it with a DataModule then I think you don't have the problem anymore or like in my example.
    When using DataModules all Querie and Dataset are everywhere available.


    Having Query and datasets available on a form has no added value, it's the wrong approach for database development.

    Regards Peter

  2. Hi,

    You will always have to perform the installation of the runtime package once on the server...just like every other software.
    That's also when you have to install a certain version of .NET on a server or an update thereof, for example. This also works with an installer.

    Microsoft update packages can be distributed via a so-called WSUS server to servers that you manage.
    Maybe it is possible that the person who manages the servers and performs updates with his software
    he also can include the uniGUI runtime package with an update.

  3. I did a simple test within my existing application which uses forms and frames.
    The frame contains the dbgrid so i tested is like this in the uniFrameCreate event i put this simple code:

    var
      P : Integer;
    begin
     if not dmType.TypeCountry.Active then
              dmType.TypeCountry.Active;
              dmtype.TypeCountry.Open;
              P := 5;
             dmType.TypeCountry.Locate('typeCountryID', P, []);

    Result is the record pointer is to the record with ID=5, see blue line in dbgrid...WORKS

    Make sure that the variable you use is of type integer!

     

    dbgrid.thumb.png.c50a78ee3f3ea0814f1085f2545e9929.png

     

     

  4. The Locate method is intended to search for a record; the IndexFieldNames property is intended to sort records on the client.
    These operations are only performed after fetching all data matching the query.

    Maybe the problem is that,- at the moment you execute the code, NOT ALL RECORDS are loaded because
    of TMyQuery.FetchAll = false. Then only the amount of records are loaded which is se by TMyQuery.FetchRows

    When you you execute code by button maybe all or more records are loaded on that point.

    So ....set the TMyQuery.FetchAll property to True;
    and see if it changes the behavior.
     

    Regards

     

     

  5. Hi

    It depends on what you want to achieve. In your current setup you have no fail-over at machine level. So when VPS - Comapny2.myapp.com fails or is going down
    then this company can't use the application anymore.

    You have now made a split by assigning a vps per customer with your uniGui stack (IIS, HyperServer, UniGuiApp and Database)
    If you want to achieve a fail-over in the event of a machine failure, you must ensure that there is a complete copy on a fail-over vps
    where the correct ip address is again linked to this vps server.

    What you could do is run multiple application environments on 1 VPS (vps-A). You then get:
    - 1 IIS environment
    - 1 Hyper server
    - in this case 3 uniGui applications
    - 1 MySQL installation with its own database per customer

    A 2nd VPS (vps-B) is an exact copy of vps-A. If you change something on vps-A (eg an update of your application), you ensure that this is
    automatically synchronized to vps-B. Sufficient tools are available to synchronize the database. vps-B is actually a so-called standby server
    and is used when vps-A fails

    vps1.png.eada4ba7e7b43b7678a1a63c13306e52.png

    There are roughly 2 ways to monitor / realize / check if vps-A is up-and-running
    - DNS level failover
    - Server-level failover

    DNS level
    A DNS fail over can be setup using online DNS IP failovers but they cost money and many people say they are not as good as doing it on
    the server level, since at DNS level they check your hosting on intervenes and these can be from 4- 10 mins at any time. A Quick Google
    search reveals DNS Failover System Monitoring.

    Server level
    Normally you would proceed with the following:
    - Replicate Clone of MySQL on both Servers
    - Clone the file systems using clusters
    - Interment a IP fail over using something like UCARP

    A VPS is a virtual private server, so it is already virtual. There are providers that offer the option of purchasing a disaster recovery plan
    at VPS level, for example, where they ensure that your vps-A is automatically copied to another server and started again with the same ip address.
    This is what, for example, hypervisors like VMware do and is called Replication
    ovh.com offers very extensive possibilities when it comes to failover solutions or disaster recovery
    https://docs.ovh.com/gb/en/dedicated/ip-fo-move/

     

    A other solutions can be this where you do it self:

    vps2.png.c3e3544436d261a6e691f2c0f8735709.png

    A second machine is always easy to switch everyone to vps-B during maintenance of vps-A. Then perform maintenance and switch the users back to vps-B and then you do maintenance on it. 

    It is important to first consider what form of continuity and redundancy you want to achieve. Then you can think about the concept and realize it 

    Greetz Peter

     

    • Upvote 1
  6. hi

    I have a event management system for events en festival is also create invites with qr-code but without any problem
    What i do is when a user is added to the database i create a 19 digit unique 'barcode' number based on date+date...till milliseconds and the number
    is stored in the database....you need it for scanning. you can do it on the OnNewRecord event of OnBeforePost

    What i see from you code is that you created on the UnimFormCreate and possibe the same values are use for
    creating the qrcode number.

    I use fastreport to to create the qrcode imge...i have a report with the format off a general phone screen. 
    Now can I set up other information besides the qr code like event name and entrance location and date/time

     

  7. Hi Dominique

    There are a number of issues that can make it difficult to investigate where the issue is:
    - you have moved from TransIP to Xenius (2 different environments)
    - you go from Server 2016 to 2019
    - how is the server park accessed over the internal network .. 10GB?
    - both use different hardware for their VPS environment
    - which hypervisor to use for the VPS servers (Microsoft Hyper, VMware ESX or ...?

    More CPU, Memory and Disk is not always a guarantee that something is faster, especially with a VPS server. It mainly depends on the underlying layer and the configuration of the hypervisor.

    When does the problem occur:
    - when a user accesses the application through his browser / environment?
    - does it also occur when you are logged in to the server and start and use the application there?
    - it also occurs when, for example, you upload 5 GB of data to the server, compared to the 2016 server

    Some performance issues are known in combinations, for example of Dell hardware, Hyper-V and Windows 2019,
    but also other performance issues between 2016 and 2019.

    Do other applications run fast/normal or can it be traced back to uniGui?

    There are Server 2019 environments where they reconfigure network disclosure so that it behaves more like a Server 2016 environment:

    LAN

    Set-NetTCPSetting -SettingName "DatacenterCustom" -CongestionProvider DCTCP
    Set-NetTCPSetting -SettingName "DatacenterCustom" -CwndRestart True
    Set-NetTCPSetting -SettingName "DatacenterCustom" -ForceWS Disabled

    Set-NetTCPSetting -SettingName "Datacenter" -CongestionProvider DCTCP
    Set-NetTCPSetting -SettingName "Datacenter" -CwndRestart True
    Set-NetTCPSetting -SettingName "Datacenter" -ForceWS Disabled

    WAN

    Set-NetTCPSetting -SettingName "InternetCustom" -CongestionProvider CTCP
    Set-NetTCPSetting -SettingName "InternetCustom" -DelayedAckTimeoutMs 50
    Set-NetTCPSetting -SettingName "InternetCustom" -ForceWS Disabled

    Set-NetTCPSetting -SettingName "Internet" -CongestionProvider CTCP
    Set-NetTCPSetting -SettingName "Internet" -DelayedAckTimeoutMs 50
    Set-NetTCPSetting -SettingName "Internet" -ForceWS Disabled
    This reconfigures 2019 to behave a little more like 2016.

    • Like 1
    • Upvote 1
  8. Hi

    Your problem regarding question 1 will also be solved. Because now a record in the value table is linked to a user. In your previous case, you didn't have that and the record didn't belong anywhere and was visible everywhere.

    In addition, I would not use a dbnavigator but just buttons that you turn on / off based on the status of your DataSource.

     

    msedge_tlBOeQTE1r.png.d01bb11b677d7fe764626f0f6e5fd828.png

    The text is dutch but is as follow:
    NIEUW = New (button is default enabled)

    BEWAREN = Save (button is default disabled)

    ANNULEREN = Cancel or Close (button is default enabled)

    Then on the datasource.OnStateChange event i use the following code:

     

      // Form is already created
      if UniMainModule.GetFormInstance(TFormTypeCateringEdit, False)<>nil then
      begin

        // Database in WEERGAVE modus
        FormTypeCateringEdit.btnAdd.Enabled       := TypeCatering.State in [dsBrowse];
        FormTypeCateringEdit.btnSave.Enabled      := TypeCatering.State in [dsInsert,dsEdit];
        FormTypeCateringEdit.btnCancel.Enabled  := TypeCatering.State in [dsBrowse,dsInsert,dsEdit];
      end;

    As you can see in the code above:

    button NIEUW / NEW is enabled when the database is in Browse mode
    button BEWAREN / SAVE is enabled when the database is in Insert or Edit mode so you can save the record
    button ANNULEREN / CANCEL is enabled when database is in browse,insert or edit mode. This because you want to have
    a cancel function when you either add a new record or change an existing record in addition, the button closes the form.

    When the database is in insert / edit mode the function is CANCEL database action.
    When the database is in browse mode the function is CLOSE

  9. Hi Sergio,

    The big difference is that you now go from single user to multi-tenant use. Your VCL application runs stand-alone and now you go to the web and the user is only allowed to see his own records. That is multi-tenant use within your application.

    You can easily solve this by creating a separate table with users and a seperate table for the value. You give them a username and password.
    Every registered user, and therefore record, has a recordID (unique number). 
    After logging in you can, for example, use a variable to link the recordID or use it as a parameter in your query to make a selection from all records of this one user.

    When the user creates a new record in a database, you save the user recordID into the table. (OnNewRecord event)

    So you will have to do a small redesign of your data model:
    - 1 table for users
    - 1 table for the values

    When the tables are filled they will look like this for example

    sergio1.png.e571160cb7055a82f8dd4172123643a4.png

     

    After the user has logged in and you use the recordID to select the records in the table 'Values' (at the right), he only sees his records.

    In this example you are logged in as Sergio and only the records in the  VALUES table with UserID = 1 (Sergio) will be showed

     

    sergio2.png.60ed854157132709668918363d469084.png

     

     

  10. Hi

    I use additional components for multi-language
    www.regulace.org
    or 
    www.tsilang.com

    Of course you can also do it yourself with the help of a database in which you place the translations.
    My preference was for an existing and working solution that I can use directly for Win32 and uniGui applications.
    The work you have to come up with something yourself takes me more time than the purchase of a
    component ... but that is of course different for everyone

×
×
  • Create New...