676

(15 replies, posted in General)

Hi Derek,

thanks for the hint this is part of the user requirement, separate permission, thanks for the input.

I still struggle with the "simple" user interface where people would input data by simply choosing a category in a drop down list to add data in the chosen list. To me it is a mistery...

I could create a very basic interface to input data but still the fancy feature escape to my current knowledge

677

(14 replies, posted in General)

I found a bug in final version 1.51:

if you use "AR_" as a TextBox Mask, the "A" is replaced by "_" which gives "_R_".


Could you have a look please?

678

(15 replies, posted in General)

Hi there,

I have a big project on the table and I just wonder how to figure out some specific user requirements such as the ability to choose in a list what kind of information to add in a table...

example given:

I have 10 tables, let's call them T1, T2, T3....T10.

Most of these table require separate feedings and the user would like to avoid to clutter the user interface (which is ergonomic), thus they want to see one drop list to chose which information to add and then, get the correct feeding form.

BUT....(on top of that) some information must be linked together so if one information is added in a table, I must be able to select the linked information as well. My brain is starting to hurt.

If I need to add data in T2, it must also be related to T1 and/or T3

I have attached a picture of current schema, I am looking for scripts or forms or any kind of help.

It works great now, thanks Dmitry

Thanks Dmitry,

it works better, even changing the password in the script prevent the program to start but when I add a user, I get a strange behavior: I am asked 3 time to click OK on a window displaying a 5 digits number and the information in the field appears as encrypted until it is saved!

Sorry to bother you but any idea regarding the autotransformation of characters in the DB? My own username is using this combination of letters and I cannot use my application if I use the script.

Hi Dmitry,

I found a bug using your example with v 1.51: when you add a user with a name containing onth or onh, the "N" transforms into a "L" for some reason!

683

(14 replies, posted in General)

The main point is to know how many people need to access the data at the same time?

684

(14 replies, posted in General)

I think I understood your problem and I think you might need to re-think the whole thing to create a unique database using MVDB with different level of authorizations for your different users as MVDB manages only 1 database.

I would suggest to analyze all the relationships and all the tables and then recreate a new database with as many tables and columns as required. Always aim to keep it simple!

You could still import the data from MS Access.

First step would be to consolidate your data but I think that for your specific use, you should look for a centralized database server with a web application portal...

I am still active hmm  and not a king at all in Delphi programming but the community here is great and very friendly and I already learned a lot!

I do prefer humble community over stiff upper lip communities where not knowledgeable people are just kicked off when asking...

Thanks Dmitry, the weakness is that the password is readable in clear in the script.dcu so it is possible to hack the table using an external tool.

687

(6 replies, posted in Talks about all)

Génial! Merci pour les tuyaux les gars ! smile Surtout les snippet managers que je ne connaissais pas.

Great!! Thanks for the tips guys! smile

688

(3 replies, posted in General)

Good to know! Might be a property for TextBox as well smile

689

(6 replies, posted in Script)

Dmitry

I sent it to you yesterday evening smile

690

(187 replies, posted in General)

Would it be possible to add a TextHint property to TextBox objects so we would not need to script it?

Encrypt the Script.dcu as a binary so it would be more difficult to hack the script?

Great, this does nearly what I want to do, when you try to read the data using an external tool, the data are not readable; this is what I call preventing read from external source.

The problem is that the encryption password is in clear text in the script file.... big_smile

Is there any chance to encrypt the script file as well in a future version? This would prevent unauthorized people to modify the application as well.

Next step would be to write a script to check if a user is allowed to open the application or not as follow:

Allowed users stored in encrypted Table "MVDB_users"

open application --> check users in "MVDB_users" using sUserName := '"'+GetUserName+'"';


- if user exists = Application open                                                                                                                                         

- if user does not exist= display warning then Close application


Is it possible?

would it be possible to restrict the use of an application to a list of users contained in an encrypted table with a message displayed in case of misuse followed by an application closure?

Purpose of the encrypted table is to avoid reading the data using an external Sqlite tool smile

example:

allowed users stored in encrypted Table "MVDB_users"

open application --> check users in "MVDB_users" using sUserName := '"'+GetUserName+'"';


- if user exists = Ok
                                                                                                                                         

- if user does not exist= display warning --> Close application

Another stronger method would be to link the application to the connected network, I do not think it is currently possible...

693

(4 replies, posted in General)

Which version of MyvisualDatabase are you using?

694

(6 replies, posted in Script)

Hi Jean.brezhonek,

I would like the grid to refresh every time the form is shown as it works with "Form1.Chk_restage.Click". Currently to refresh the 3rd grid(Quarantine), I had to reload the application so I added the "grid on change" for Form1.Chek_quarantine.Click to reload on every change.

The strange thing is that I do not need the "grid on change" for the 2nd grid (Chk_restage).

I will send the project to Dmitry for close examination.

695

(10 replies, posted in SQL queries)

I finally managed to get it working with a trick smile

I use a table to store the username captured by Dmitry's script and then I added a select in my trigger to get the last username_id.

Into MVDB scripts:


Setting the variables

// Global variables declarations
var

   sUserName: string;

Saving the username with current date into Table "WindowsID" when starting the application

// Load automatically information into grids in form1 + operator tracking
procedure Form1_OnShow (Sender: string; Action: string);
var
sCurrentDate: string;
begin
    sCurrentDate := '"' + FormatDateTime('yyyy-MM-DD hh:nn:ss.000', now) + '"';
    SQLExecute ('INSERT INTO WindowsID (DateTime, AccountID)' + 'VALUES (' +sCurrentDate+', '+ sUserName +')');
    Form1.LastUser_Grid.dbUpdate;
  

end;

Getting the current Windows username

Begin
// get current windows user login 

    sUserName := '"'+GetUserName+'"';

End.

And then, using SQLiteStudio, I create my triggers to log as much information I want:

Insert trigger:

INSERT INTO logs  (    
    Change_date,
    New_Id_user,            
    sqlAction         ,
    New_usr_Name       ,
    New_firstname     ,
    new_UsrID    ,
    new_dpt            ,
    New_Room      ,
    new_id_costcenter   ,
    New_id_computer ,
    src,
    Username      
        
    )

          values (DATETIME('NOW','localtime'),new.id,'INSERT',new.Name,
                  new.Firstname, new.UserID,
                  new.Dpt,new.Room,new.id_CostCenter,
                   new.id_Computers, 'Users',(select AccountID from WindowsID where id= (select max(id) from windowsID))
                 );


Update trigger:

INSERT INTO logs  (    
    Change_date,
    New_Id_user,            
    old_ID_user            ,
    sqlAction         ,
    Old_usr_Name       ,
    New_usr_Name       ,
    Old_firstname     ,
    New_firstname     ,
    old_UsrID   ,
    new_UsrID    ,
    old_dpt            ,
    new_dpt            ,
    old_Room     ,
    New_Room      ,
    old_id_costcenter   ,
    new_id_costcenter   ,
    Old_id_Computer       ,
    New_id_computer  ,
    src ,
    Username    
        
    )

          values (DATETIME('NOW','localtime'),new.id,old.id,'UPDATE',old.Name,new.Name,old.Firstname,
                  new.Firstname,old.UserID, new.UserID,old.Dpt,
                  new.Dpt,old.Room,new.Room,old.id_CostCenter,new.id_CostCenter,
    old.id_Computers,new.id_Computers,'Users',(select AccountID from WindowsID where id= (select max(id) from windowsID))
                 );

Delete trigger:


INSERT INTO logs  (    
    Change_date,            
    old_ID_user            ,
    sqlAction         ,
    Old_usr_Name       ,
    Old_firstname     ,
    old_UsrID   ,
    old_dpt            ,
    old_Room     ,
    old_id_costcenter   ,
    Old_id_Computer ,
    src ,
    Username        
        
    )

          values (DATETIME('NOW','localtime'),old.id,'DELETE',old.Name,old.Firstname,
                 old.UserID,old.Dpt,
                  old.Room,old.id_CostCenter,
    old.id_Computers, 'Users',(select AccountID from WindowsID where id= (select max(id) from windowsID))
                 );

696

(6 replies, posted in Script)

I used another procedure to make it working but it looks more like a workaround as i see nothing preventing it to work properly in the above script...

   //Auto count status + Quarantine refresh
procedure Form1_GridSearch_OnChange (Sender: string);//Load automatically information into grid form1.ReadyGrid on change
begin
    Form1.Button1.Click;
    Form1.Chek_quarantine.Click;
end;

697

(6 replies, posted in Script)

Hi there,


I am facing a strange issue with a script which loads automatically informations in grids using scripts ( auto click on form show)

this works perfectly well with already existent object created prior 1.51 but the one created using 1.51 does not refresh

// Load automatically information into grids in form1 + operator tracking
procedure Form1_OnShow (Sender: string; Action: string);
var
sCurrentDate: string;
begin
    sCurrentDate := '"' + FormatDateTime('yyyy-MM-DD hh:nn:ss.000', now) + '"';
    SQLExecute ('INSERT INTO WindowsID (DateTime, AccountID)' + 'VALUES (' +sCurrentDate+', '+ sUserName +')');
    Form1.LastUser_Grid.dbUpdate;
    Form1.Button1.Click;
    Form1.Chk_restage.Click;
    Form1.Chek_quarantine.Click; // the only one which does not work -- added using 1.51




    // Display Release Note (About) with select in database
    Form1.MemoAbout.Text := SQLExecute('SELECT Rel_Note FROM Release WHERE id=1');
    Form1.MemoAbout.ScrollBars := ssVertical; // The component has a single scroll bar on the right edge.

end;

The Form1.Chek_quarantine.Click does not refresh autiomatically when I make changes whereas the others work perfectly well.

To refresh the grid, I have to reload the application!

Any hint?

698

(4 replies, posted in General)

I agree with Derek, but the direct edition should imply more control on the changes as they would be more prone to input errors.

699

(16 replies, posted in Reports)

I think that it is not a good idea to rely on an external program especially any Microsoft Office program for reporting with MVDB as many users may not have MS Office installed on their computers or the right version.

700

(3 replies, posted in Script)

Hi Dmitry,

thanks again, you are the fastest!

Just 2 questions:

1 - How could I customize the message window title?


http://myvisualdatabase.com/forum/misc.php?action=pun_attachment&item=953




2 - How could I set the max value to be checked with a sql query? (programming is not yet my greatest skill)