Hope something like this can get you started to what you are looking for.
77 2022-08-02 22:37:02
Re: IconChanger (9 replies, posted in Database applications)
Here's an updated link of the project.
78 2022-07-15 02:36:21
Re: Hash (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 2022-07-12 06:28:29
Re: ID User (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 2022-07-11 20:21:38
Re: Saving Record (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 2022-07-11 02:09:49
Re: Help please! (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 2022-06-25 16:38:24
Re: Saving Record (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 2022-06-04 02:52:39
Re: How to use the calculated field (7 replies, posted in General)
Maybe this post will give you some ideas
84 2022-06-03 06:08:01
Re: How to use the calculated field (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 2022-05-21 22:29:15
Re: Decrypt password (2 replies, posted in General)
Check on this one http://myvisualdatabase.com/forum/viewtopic.php?id=7915
86 2022-05-20 17:53:48
Re: Table Dictionary (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 2022-05-19 04:35:14
Re: How to Encrypt MySQL Connection Information ? (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 2022-05-16 00:24:46
Re: FastReport Edit Page (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 2022-05-15 20:28:39
Re: FastReport Edit Page (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
90 2022-05-14 05:39:20
Re: MDV to be made open source as it is no longer updated (2 replies, posted in General)
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 2022-05-02 12:05:44
Re: On delete cascade by script (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 2022-05-01 18:08:59
Re: insert value in all the records of the table (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 2022-04-30 21:58:06
Re: OnSQLException (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 2022-04-27 23:04:47
Re: Question for Delete (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 2022-04-23 22:33:58
Re: Change ShowMessage box text color (2 replies, posted in General)
As for me, I would create form for my custom message/confirm dialog.
96 2022-04-20 21:31:48
Re: how to convert number to letter (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 2022-04-20 21:16:47
Re: How to add Save Password ? (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 2022-04-20 07:24:17
Re: Separation of days for a period of time (7 replies, posted in General)
Maybe something like this might help you.
99 2022-04-13 07:12:45
Re: How to get calculated fields in queries? (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 2022-04-09 08:51:53
Re: How to edit User form ? (4 replies, posted in General)
Changing this module, in my personal preference, I'll have my own module and forms to update user details.