1

(19 replies, posted in General)

Thank you, Derek.
It looks marvelous.
I'll try to implement it.

2

(19 replies, posted in General)

Thanks, Derek,
I found the solution using your explanation.
(BTW, it seems to me in the script is something wrong, the search button disappears somehow).
I have one question more.
Is it possible to add two or three more buttons to form2:
- "Delete record" that will delete existing record  and go back to form1( if it is not too tricky because of attached files)
- "Next record" that will show next record from Form1TableGrid1 (if exists),
- "Previous record" that will show the previous record from Form1TableGrid1 ( if current record is not the first in TableGrid1).
Thanks

3

(19 replies, posted in General)

It is about the last version: MyProject1 fixed4.
I have noticed that a record can be added even though the limit has been reached in case the "search" button is clicked  and if TableGrid1 contains fewer records than the limit is set.
I tried with the script below.
Is there a better solution?

  procedure Form1_Button4_OnClick (Sender: TObject; var Cancel: boolean);
   begin
   form1.button1.Visible := false;
   end;

Thanks in advance.

4

(0 replies, posted in General)

Searching through this forum (both sections in English and Russian) I have found several different options for creating a trial + registered version of my database and it is difficult for me to evaluate which one is the best. I am aware there is no perfect protection but it would be nice to hear the opinion of experts which one to use.
What is your suggestion?
Thanks in advance.

5

(19 replies, posted in General)

Thanks for your great support, Derek.

6

(19 replies, posted in General)

Thanks, Derek,
I also thought in a similar way, to cover the right part of DBFile1 with the Panel, but the "delete file" is still missing. Can a delete button be added?
Or prevent the user somehow to add the file with comma.
The best solution would be to completely remove DBFile and add a new table  and the script with the ability to add file (perhaps multiple files); replace, view, and delete files, but I'm quite sure I'll be unable to do that.
Hopefully, I am not so tedious and too demanding.
Any help is really appreciated.

7

(19 replies, posted in General)

Hi, Derek,
I have tried many times to attach files and "Open file" as well as "Open folder with file" in both ways.
Your way with the added buttons "Open storage" and "Open file" works without error, but keeping both options is a bit confusing.
It seems to me, I found a reason for the strange behaviour of "Open folder with file" in DBFile.
For some reason, the name of the attachment must not contain "," (comma).
I don't know if it's a bug in MVD, that can be corrected somehow (or bypassed) or is something specific in my PC or I am doing something wrong?
Any advice?

8

(19 replies, posted in General)

Thanks Derek for your effort. It is really very valuable for me.
Please, see an attached mp4.
The issue could be with two textboxes in Form1, that are either empty (if save button in form2 is clicked) or the same (if the cancel button is clicked). Even when any other row is highligted for deleting they remain the same and it is a question what picture or file will be deleted.

9

(19 replies, posted in General)

Hi, Derek,
I tried and it seems to be OK for now.
Just one thing regarding the attachments.
When I click to Open folder with file then opens the whole PC (This PC) instead just the storage folder . I checked out, attachment is really in storage and I can open and delete it  clicking to Open file or Clear.
Is there anything that can be done about it?

10

(3 replies, posted in General)

Thanks.

11

(3 replies, posted in General)

I added Form4 to my project.
Is there an easy way to make a Form4 as a starting form instead of Form1?

12

(19 replies, posted in General)

Thanks, Derek.

13

(19 replies, posted in General)

Thanks, Derek,
That was very valuable.
Without your help, I would have given up.
One more thing.
For other option (with no limits of records) I should:
- delete the part of script related to Form1_ Button1_OnClick
- change the property of Form1.Button1 to New Record
- clear the Events of Form1.Button1
- clear the Events of Form2.Button1
Am I right or wrong again?
Otherwise, I can set the limit to 1000000 eg.

Here is attached my very first project. Hopefully, it is not the last one.
I am trying to make a simple database for storing of few text info along with picture and attached files (for each record) but in separate files called “storage” and “gallery” following the lot of examples, tips and instructions from this forum (in English and Russian language).
I’ve been struggling with this for over a month but I still haven’t been able to do it the right way.
There are a some issues I can't solve and professional help will be very appreciated.
1.- From the very beginning, problems with storing and deleting files into and out of "storage" and "gallery" occasionally occur. For example, it happens Form2 shows no photo in picturebox and / or no attachment in DBFile1 even though they still exist in storage and gallery. The opposite happens too, ie the picturebox and DBFile1 show attached files even though they are not in the storage and gallery (somehow are deleted). Also, very often if I change the photo in picturebox, the old photo still exist in gallery (it is not deleted).
2.- I tried to make limit of records in TableGrid with this code:

            procedure Form1_Button1_OnClick (Sender: TObject; var Cancel: boolean);
         begin
     if form1.tablegrid1.rowcount >= 10  then form3.show  else form2.show;        

 end;

At the same time I changed the Properties and Events of "Add" button to "no action" and "Form1 Button1 OnClick". It seems to me it is working but the new problem arrives. When I click the Add button, the form opens but with no empty fields. The fields are filled with the previous record.
3.- I have a DateTimePicker in Form2 that should be included and visible in TableGrid1 and print report too.
Report printing in both cases seems to be OK (Printing one record or printing all the records). Only the Recorded Date is missing in print report, because is missing in TableGrid1 too.
I rely on the help of Derek and other experts from this forum.
Thanks in advance.

15

(7 replies, posted in Script)

OK. Thanks, Derek.
If I am going to use the code mentioned then I can delete Form3 and tablelimit.
Am I right?
BTW, I am just curious why this code below is not working?
(if button4 visibility is true, selected in properties).

procedure Form1_OnShow (Sender: TObject; Action: string);
begin
Form1.Button4.Visible := False
end;

16

(7 replies, posted in Script)

Thanks, Derek,
Your suggested solution sometimes works sometimes it doesn’t.
In short, sometimes I am not able to change the limit in form3.
Unfortunately, that happens with almost everything I tried to do in the MVD.
Very weird but sometimes it works, sometimes it doesn’t and I’m close to giving up the MVD altogether.
Please, explain me, is there any reason for this simple solution below to be incorrect?
(Form4 is instead of message.)
Thanks in advance.

     begin
  if form1.tablegrid1.rowcount >= 10  then form4.show  else form2.newrecord;
end;

17

(7 replies, posted in Script)

OK.
I found in button4 properties.
What about the using Limit property of Datagrid1?

18

(7 replies, posted in Script)

Thanks, Derek,
But I want the form1.button4 and form3 to be invisible for the user all the time.
I tried with 3 options   but nothing is working:

   procedure Form1_OnShow (Sender: TObject; Action: string);
          begin

                Form1.Button4.Visible := False
          //    Form1.Button4.Enabled := False;
             //  Form3.Visible := False


          end;

19

(7 replies, posted in Script)

I am trying to create simple database with two forms, one table  and one datagrid in first form.
I want to limit numbers of records that can be saved by user.
The user is not allowed to save a new record if Datagrid in Form1 already contains a certain number of records, eg 100. And the corresponding message appears.
Is there reliable script to do that?
Thanks in advance.

20

(2 replies, posted in Script)

Thanks, Derek.

21

(2 replies, posted in Script)

I want to add to my database a piece of code that will be kind of minutes counter.
Textbox on my form1  shows counted minutes only while the user uses the database. The counted time should be saved until the next time the database is open, then the counting will be continued starting from the recorded number of minutes until the textbox shows a certain number, eg 100. Then  some actions should be done, for example:
-  a button1 disabled
-  a Datagrid  invisible
- show a some message or label...
An example of such a project would be greatly appreciated.
Thanks in advance.

Thanks, Derek,
That's what I need.
Thank you very much for your support.

Some additional explanation:
My goal is to print the date when the record is saved.
I have a DateTimePicker1 in my Form2 associated with the TableName: mytable and FieldName: Date.
When a new record is added I can see the date in Form1.TableGrid1 in a proper format, for example 1.10.1980. All I want is to print this info in same format.
In report preview, I have a component Report.mytable.Date ( in MasterData1), but finally I get the date in form 10.1.1980 instead of 1.10.1980.
I can't find an error.

What is the procedure to select printed date format in report?
For example: dd mm yyyy, or same with hours and minutes.

25

(3 replies, posted in Script)

Thanks , NX,
It is simple and correct.
MarkoS