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

77

(2 replies, posted in SQL queries)

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

SQLExecute('ALTER TABLE tele ADD COLUMN [id_Stoixeia] INTEGER REFERENCES [Stoixeia](id) ON DELETE CASCADE')

78

(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');

79

(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.

CONST
    ENV = 'dev';

...
...
...

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

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.

80

(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.

81

(2 replies, posted in General)

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

82

(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.

Goodluck.

83

(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.

84

(7 replies, posted in General)

Maybe something like this might help you.

85

(4 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"
else 
    Main.Panel1.Caption := "Nein";

86

(4 replies, posted in General)

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

87

(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');

88

(19 replies, posted in General)

Can you check on the error? You can see it below https://ibb.co/Y7yBrbh
Maybe you didn't have the frmSafeguard or the label in it. Check on the error.

Off topic, how can I use the image I mean to show it on my reply/post. LMAO, been a while here but I can't use that img.

89

(19 replies, posted in General)

That code doesn't affect to what DB you use. Is there any error message?
Check your user login settings too, maybe you are using dropdown instead of text

90

(2 replies, posted in Script)

try running the dbupdate after your filter

Payment.ComboBox1.dbFilter := 'id_customers = 4';
Payment.ComboBox1.dbUpdate;

Payment.TableGrid1.dbFilter := 'id_customers = 4';
Payment.TableGrid1.dbUpdate;

91

(4 replies, posted in Script)

Maybe the query returns an array. I'm thinking Combobox3 list is from slujiteli table, right?  The details you gave is a little bit vague for we don't know the Checkbox1's sqlValue, etc. For starter, maybe your select query returns an array. Try adding LIMIT 1 in your query.

newprod.ComboBox3.dbItemID :=  SQLExecute('SELECT id FROM slujiteli WHERE Default = '+ newprod.CheckBox1.sqlValue +' LIMIT 1');

My advice, try debugging it by checking the newprod.CHeckbox1.sqlvalue, then run the query from a third party sqlite viewer to check if it really returns the correct id you are getting from database. It is also easier to work on it if you can send a simple application that address to your query.

92

(19 replies, posted in General)

Try using bLogin as your reference

chkRemember.Left := frmdbCoreLogin.bLogin.Left;
chkRemember.Top := frmdbCoreLogin.bLogin.Top-30;

93

(19 replies, posted in General)

Here.

94

(19 replies, posted in General)

There's a bunch of codes here from my previous work on having a secret question and answer. I hope this can help you start on your problem.
If you find the code OnActivate

TForm(Form1).OnActivate := @activateForm;

somewhat new, you are not alone. I just learned and using it in the Project I am working with Embarcadero Delphi. Helps a lot on some circumstances.

95

(7 replies, posted in General)

Have you tried ClipboardSet?

96

(9 replies, posted in General)

Sorry. I really can't picture it out to what you really want to do.
I want to help but I need the exact and detailed process.

97

(13 replies, posted in General)

v_pozidis wrote:

What I can not understand is that if the program runs the database is active. So with your example when you close the program Form1.close how does the function replace works???

You must first backup the database using the backup button. The button will backup your current sqlite.db to [filename].dbbak using SaveDialog


Then the Add record button is just to populate the table to see if populated table will be replaced by the backup.


To backup, you then click Backup button in which the program will ask the user for a file(backup, the one you save with Backup button) using the OpenDialog, then when the user select [filename].dbbak, it will close Form1, then replace sqlite.db with the user's selected [filename].dbbak, then reopen the program

98

(13 replies, posted in General)

Form1.close; // will also close the database

// replace database with the selected backup
CopyFile(OpenDialog.FileName, ExtractFilePath(Application.ExeName)+'\sqlite.db');

// re open the application
OpenFile('samplebackup.exe');

Just a hunch that closing the main(Form1 in the sample) form will also close the database connection, then after that, you can replace the sqlite.db by the backup. Then running the executable afterwards.

99

(13 replies, posted in General)

Try this one.

100

(9 replies, posted in General)

unforgettable wrote:

Can we use it in conditional statement if....then?
How we use ( select MAX(id) from xyz) in conditional statement? for example
if (select MAX(id) from xyz = (select id_abc from xyz where id_abc = 5) then ......

I'm a bit confused to what you really want with if condition.

Is it If-else condition in script or in sql?
Then, can you elaborate to what extend you are going to use it.
Can you at least tell us the logic to why you want the if-else?
Try not to include sql query first and just elaborate the logic or problem.