John_196 0 Newbie Poster

I am making a user form in Delphi for documents tracking application. I am interested in functionalities input new entry (record) and view list by... (date, name of document, ID,...).

My problem is that I don't know how to implement these functionalities for more than one user. Currently, I have 5 users. Each user has a unique input data (record) fields (columns) and view fields (columns) of each user are also unique. There could be more users.

So, how to implement these functionalities for this form? How to assign different data (fields) for each separate user for input and view? That is what I don't understand. Is that distributed functionality of an application? If yes, how to achieve it?

Note that I don't want static assigning (hard-coded) of a user in application's code, e.g:

if(username='user1') then {
input();
view();
}
else if (username='user2') then {...}
...

because, than, every time there is a new user, developer must go back to the application's code and hard-code it. That is not efficient and is a bad implementation. Instead of this happening, the way to do this is to have in db a table of users and their details. Then write document tracking code to handle the user which is the current record in the Users table. This shouldn't require any conditional tests on a user's identity in code at all. hHow to achieve this? Could you show a concrete code sample or give a reference on it? I really don't know how to do this.

Note: I am using dbExpress tool with MySQL DBMS with RAD Studio XE7 Architect.