(7 replies, posted in Database applications)

Here's an updated link of the project.

https://www.dropbox.com/s/1dnv5mcv3sqgp … r.zip?dl=1


(2 replies, posted in Script)


procedure frmLogin_Button1_OnClick ( Sender: string; var Cancel: boolean ); // check credentials and, if okay, show Form1
///////////////  Login, password, user rights  /////////////////////
    chk: Integer;
    chk := SQLExecute('SELECT COALESCE(id, -1) FROM users WHERE lldelo LIKE '''+frmLogin.Edit1.Text+''' AND pass LIKE '''+StrToMD5 ( frmLogin.Edit2.Text )+'''');   
    // opt 2
    // chk := SQLExecute('SELECT COALESCE(id, -1) FROM users WHERE lldelo LIKE '''+frmLogin.Edit1.Text+''' AND pass LIKE '''+UPPERCASE(StrToMD5 ( frmLogin.Edit2.Text ))+'''');         

   if chk > 0 then

again, it is better for you to attach a sample working program with the problem, It would be much easier that way


(5 replies, posted in Script)

your indicated valid employee number is vague. can you elaborate it?
is it all emp no must be a 4 digit number or must 1 to 9999? Or which is which?


(6 replies, posted in Script)

frmOrderProduct.Button6.dbDontResetID := False;

This code will always make make it add new record if you are not closing the form after saving.

it will be much appreciated if you can attach if not your project, just a simple one so that people can check it out easily. It is much easier to debug with it


(3 replies, posted in Reports)

It's hard trying to create a report without the data. But have you tried having where clause?

Select employees.employees.lastname,
   Total((bsm_off.cost * bsm_off.inn))
From bsm_off
Left Join employees On employees.id = bsm_off.id_employees
Left Join orderproduct On orderproduct.id = bsm_off.id_orderproduct
WHERE bsm_off.Vidano = 1
Group By bsm_off.orderproduct


(6 replies, posted in Script)

I'm not so sure to what will be the implementation of the idea but here's a sample that will get you started. Hope it'll help.


(7 replies, posted in General)

Maybe this post will give you some ideas



(7 replies, posted in General)


Two option enter into my mind to address it.

Option 1. Do have a field (a hidden maybe) that will handle the calculated field, then put the calculation in the OnClick Event of the Save button
Option 2. If you are familiar with trigger, I am using it in some of my projects with complex saving or interaction with other table, in this sample, I just use 1 table.

Take note that you must be familiar if not expert with trigger, personally I am enjoying using triggers, procedures and functions (proc and func is only available for mySQL thou). Triggers are also difficult to maintain so for beginner, I would go with Option 1.


(2 replies, posted in General)

Check on this one http://myvisualdatabase.com/forum/viewtopic.php?id=7915


(8 replies, posted in General)

That dictionary also fixed my problem here http://myvisualdatabase.com/forum/viewtopic.php?id=7339 by setting department as dictionary


(1 replies, posted in General)


You can use built-in encrypt function of MVD to do that but personally, I wouldn't do that for it would be a hell of work if you want to debug it.

My way of adding security to the information is by creating another form, then storing a label there to handle the sensitive info such as db, username, password etc. Something like this...

{$MySQL disable_connectdialog}
     Form1.MySQLConnection.Server := '';
     Form1.MySQLConnection.Port := 3306;
     Form1.MySQLConnection.Username := SecretForm.Label1.Caption;
     Form1.MySQLConnection.Password := SecretForm.Label2.Caption;
     Form1.MySQLConnection.Database := SecretForm.Label3.Caption;

But if you really want an encrypted data, then this sample might help you


(10 replies, posted in General)

That's great derek. There you have option now frank.
For your reference or future works, here's how you do it. You can choose what button/s you want to hide by simple removing it from the equation. I used it on some of my project with trial version. I excluded their print and exprot pdf so that they can preview the report but can't do anything with it except having print screen of it.


(10 replies, posted in General)

put something like this on your Begin End. of the Script

Form1.frxReport.PreviewOptions.Buttons := pbPrint+pbZoom+pbFind+pbOutline+pbPageSetup+pbTools+pbNavigator+pbExportQuick;

Form1 being your main form

domebil wrote:

MDV to be made open source since it is no longer updated, who can recover the project?

Hi domebil,
I raised this same question for quite sometimes now.

As I work with Delphi(where MVD was made, just not sure to what version of it) for couple of months now, it has been clear to me that this will be quiet difficult (making MVD open-source) to attain. I believe that there are some paid components used to it. Fast-Report, the code editor, perhaps the map component are all paid components so for it to someone to edit/update MVD, they have to pay for all of it.

For me, as of now, I am hoping that our concerns will reach out Dmtry and if not him, maybe some of his colleague, teammates will continue on updating the project(MVD). I think that's our best hope for now.

I am continue learning Delphi for bigger projects to come. For now, our team was able to extend our application's functionality by creating sub-application on Delphi that will cater feature (like the google map component) that can't be done or is outdated in MVD


(2 replies, posted in SQL queries)

If you are trying to add a field to an existing or deployed application, then try



(2 replies, posted in SQL queries)

use update query if you want to update existing records and set the field to 1 for TRUE.

SQLExecute('UPDATE `work` SET kryfo=1 WHERE 1');


(8 replies, posted in General)

I'm not so sure if I understand your concern.

Maybe having a constant in the beginning of your script will do.

    ENV = 'dev';


function OnSQLException(Sender: TObject; Msg: string; SQL: string): boolean;
    if ENV <> 'dev' then
        // exception from button frmStoixeia.Button4
        if Sender = frmDiafora.Button39 then
            if Pos('FOREIGN KEY constraint failed', Msg)=1 then
                result := True; // to prevent system message
                MessageBox('Αδύνατη η διαγραφή. Υπάρχουν συνδεόμενα.', 'Error', MB_OK+MB_ICONWARNING);
    end; // end if dev

Then, make sure to make ENV constant to something like 'prod' when you will deploy your application.

If you really want a button in runtime, then you change that CONST to VAR, then have the function toggle the value of ENV.


(2 replies, posted in General)

You can set the tele as orphan by setting their id_Customer to null, then proceed to deleting the Customer.
I just don't know to what are you going to do with that orphaned tele data. But here's one way of doing it.


(2 replies, posted in General)

As for me, I would create form for my custom message/confirm dialog.


(9 replies, posted in General)

Something I found on that function ToWords is the fourty which has to be forty. Here's my converted function from php. Maybe you could do some tweak on the initialization and other function to meet your requirement such as changing to other language.



(19 replies, posted in General)

Here's a workaround, putting password saving function on the mousenter event of the Form1. It seems that the onActivate function runs right after the showing of the login form.


(7 replies, posted in General)

Maybe something like this might help you.


(2 replies, posted in SQL queries)

Just do if-else in the script instead of that case query

if SQLExecute('SELECT COALESCE(b.is_active, 0) as isActiveReturn FROM bookings b WHERE b.is_active=1 AND b.id_boxed=1 ORDER BY b.is_active DESC LIMIT 1') = 0 then
    Main.Panel1.Caption := "Ja"
    Main.Panel1.Caption := "Nein";


(4 replies, posted in General)

Changing this module, in my personal preference, I'll have my own module and forms to update user details.


(19 replies, posted in General)

There you have it, maybe you don't have frmSafeguard on your project.

I just put the key there for some security purposes, you can override it

ini.WriteString('REMEMBER', 'user', EncryptRC5(frmdbCoreLogin.edLogin.Text, 'YourKey'));
ini.WriteString('REMEMBER', 'pass', EncryptRC5(frmdbCoreLogin.edPassword.Text, 'YourKey'));
frmdbCoreLogin.edLogin.Text := DecryptRC5(remUser, 'YourKey');
frmdbCoreLogin.edPassword.Text := DecryptRC5(remPass, 'YourKey');