76

(5 replies, posted in General)

Hope something like this can get you started to what you are looking for.

77

(9 replies, posted in Database applications)

Here's an updated link of the project.

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

78

(2 replies, posted in Script)

try

procedure frmLogin_Button1_OnClick ( Sender: string; var Cancel: boolean ); // check credentials and, if okay, show Form1
///////////////  Login, password, user rights  /////////////////////
var
    chk: Integer;
begin
    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
       Form1.Show;
end;

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

79

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

80

(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

81

(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),Total(bsm_off.inn),
   
   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

82

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

83

(7 replies, posted in General)

Maybe this post will give you some ideas

http://myvisualdatabase.com/forum/viewtopic.php?id=6995

84

(7 replies, posted in General)

Hello,

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.

85

(2 replies, posted in General)

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

86

(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

87

(1 replies, posted in General)

Hi FMR,

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 := '127.0.0.1';
     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

88

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

89

(10 replies, posted in General)

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

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

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

91

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

92

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

93

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

94

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

95

(2 replies, posted in General)

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

96

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

97

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

98

(7 replies, posted in General)

Maybe something like this might help you.

99

(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";

100

(4 replies, posted in General)

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