51

(12 replies, posted in General)

Salut Jean,
You should be able to send your message / project using the email associated with the userid (see screenshot).
I tried to message you yesterday using your ***@laposte.net address but it couldn't be delivered.
Regards,
Derek.

52

(12 replies, posted in General)

Hi Jean,
Not a problem.
Derek.

53

(1 replies, posted in General)

Without attaching your project to let people see exactly the problem, it's hard to suggest anything.
One immediate question (again, without having seen your project) is why you need to use a separate search form?
Derek.

54

(6 replies, posted in General)

I guess it's also possible, instead of using triggers,  to write a script to also log changes to whatever fields you need to audit (not all fields are critical).
Please see attached as a simple example.
Derek.

55

(1 replies, posted in General)

Hi TCS,
It works for me as of 5 minutes ago (although I did have to click the 'extra' prompt ("if your download doesn't start automatically, click here).
Or there is also a link to 6.6.1 (Beta) that Konstantin (K245) has provided - https://drive.google.com/file/d/1Q7Rk73 … 3RFwm/view
Regards
Derek.

Salut Jean, Sparrow, Vladimir,
I think the issue is when you are clearing the inputs, it is at the same time trying to perform the calculation and so is hitting the dreaded 'invalid floating point' issue.
Perhaps just modify your script like this

procedure Form1_Edit10_OnChange (Sender: TObject);
Var s9,s10 : Extended;
begin
     S9  := Form1.Edit9.Value;
     S10 := Form1.Edit10.Value;
     if (form1.edit9.value <> 0) and (form1.edit10.value <> 0) then Form1.Edit11.Value := (s9 / s10)* 100;
end;

And I think that should fix it.
Derek.

57

(1 replies, posted in General)

Hi,
If, as in your example, you only have two order statuses ('waiting' and 'ok'') then wouldn't it be easier to just add a boolean field to table 'aaaa' rather than use a related table 'xxxx'.  That said, in my opinion, there are issues for the end-user using boolean fields (centred around the 'allowgrayed' condition and the fact that the 'checkbox cannot be resized and so making it rather awkward in use.
Another approach would be to use a combobox instead of a check box (I was a bit puzzled that you already use a combobox on Form2 but then choose to use a checkbox on Form1). 
Personally, I find comboboxes a better option because
1.  more user friendly
2.  in the tablegrid, you can display the actual combobox value rather than 'yes' or 'no' (as is the case with booleans)
3.  if you need to add new options (not just 'waiting' and 'ok') then it can be done without any re-working of the program.
4.  if you use the multi-select option with the combobox, you have complete flexibility as to what combination of options you want to include / exclude when filtering.
Both the 'boolean' approach and the 'combobox' approach are in the attachment.
Of course, there are other possibilities as well but these would probably involve some script.
Hope this helps,
Derek.

Привет,
Не видя вашего приложения и не зная вашей схемы данных, трудно что-либо предложить.
Но если вам нужен очень простой подход без сценария (ну, он есть, но только в косметических целях), то, возможно, вложение может дать вам некоторые идеи.
Он не дает вам краткого описания по каждому вопросу, но дает вам возможность
1. добавить новые варианты (а не только 1, 2 и 3)
2. позволяет вам задать вопрос «а что, если» — сколько человек ответили «2» на вопрос 1, «3» на вопрос 5 и «1» на вопрос 8 и т. д. и т. п  и увидеть промежуточную сумму
В зависимости от разрешения экрана вы можете настроить ширину столбцов в скрипте.
Derek.

59

(1 replies, posted in Russian)

Привет,
Посмотрите на скриншот во вложении и пример проекта.
Действительные пользователи и пароли
Admin/admin - неограниченно
Derek / Derek - неограниченно
Colin / Colin — имеет доступ только к отделу «Research».
Brian / Brian — имеет доступ только к отделу «Accounts» и Отдел «Sales».
С уважением,
Derek.

.
Have a look at the screenshot in the attachment and the sample project.
Valid users and passwords are
admin / admin - unrestricted
Derek / Derek - unrestricted
Colin / Colin - can only access 'Research' Department
Brian / Brian - can only access 'Accounts' Department and 'Sales' Department.

Hi Roberto, Sparrow,
Am I correct in thinking that you need to populate your tables manually (with SQLiteStudio or something like that ) with default values otherwise the application crashes?
But the main puzzle for me is when you change (and save) the edit foreground colour - it displays correctly but then when you try to type anything in the edit field, it reverts to the default color.  And yet this doesn't happen with the memo field - that behaves as it should.
Do either of you have any suggestions how to fix that?
Attached is my attempt at changing colors although I used my own example so it is not directly comparable to yours.
One thing I did add is a 'reset' button so that all the colors revert to their default settings (perhaps useful when the form starts to look like a 1970s disco big_smile )
Regards,
Derek.

Hi Eyeman,
Hope you're keeping well.
Yes you could always limit the initial load to a set number of records with a filter than runs when you start your program.
However, from the screenshot, I see that you're only loading 2482 records (can't see that any filters have been applied);   if I remember rightly, that will be from the lead table 'opd_registration' which isn't really that many rows (notwithstanding your large number of tables and relationships).
So I'm wondering if there are other things that are making your program run slowly.
Maybe it would be better if you upload your project and people could have a look and see if there are other areas that could be looked at to improve performance (for example, the number of calculated fields or if you're looping through grids to apply column formatting etc etc).
If you have concerns about data privacy, you could always take a copy of your project and then anonymise the names before zipping and uploading.
By the way, love the 'LifeStatus' of 'Alive&Kicking' big_smile
Regards,
Derek.

62

(38 replies, posted in Russian)

Hi All,
I was also having a look at this post a couple of days ago.
The main problem for me was that using a picture with a rounded frame only really works with form objects where the background colour can be changed (to match the background of the picture itself) and / or the object's frame can be minimised;  fine for edit objects, memo objects. panel object and combobox objects but it rather falls down with datetimepicker objects, checkbox objects, tablegrid objects and, of course, the form itself.
One further point, if you use 'styles', then you additionally need to switch off style elements for each object that you are trying to 'round' in a script.
So while the effect looks very good, it's possibly outweighed by the inconsistencies and extra code. 
So rather than try to apply 'round edges' to all form elements, an acceptable compromise, as Konstantin writes,  might be to just use rounded images as pseudo panels and then have any other objects inside the 'panel image' without any rounding.  Personally, I prefer to use 'panel images' that are solid colour rather than with a thin border - this helps to minimise the distortion that you get when you resize the 'panel image'..

Derek.

63

(2 replies, posted in General)

Hi Manix,
Have a look at the attachment (specifically lines 60-80 in the script - it's Dmitry's code from an example he posted on the Forum some years ago that you should be able to find if you search for it)..
1.  double click on a date, enter some text and save - this will bold the date.
2.  double click on a date, delete the text and save - this will un-bold the date.
3.  enter any search criteria at the bottom of the calendar (or '?' to see everything).
It actually makes the date on the calendar bold rather than highlighting it but maybe this is sufficient for what you want.
Derek.

 if length(month) = 2 then Form1.Edit1.Text  := (IntToStr(Month)) else form1.edit1.text := '0' + (inttostr(month));

65

(3 replies, posted in General)

  sqlexecute('update example set exampledate = date(exampledate)');

removes the 00:00:000

Hi FMR,
You can't just do it as you have tried (Form1.DateTimePicker1.Format := 'MM')
This is just an edit mask that is placed on top of the datetimepicker field and doesn't change the underlying data.
So you need to convert your datetimepicker field to a string and then substring the part that you want (month).
Be aware that the attached example works for a dd/mm/yyyy date format so you might need to amend the code if the date is formatted differently in your country.
Regards,
Derek.

67

(3 replies, posted in General)

Hi,
The short answer to your question is 'no, you don't need to store the date in a text field'.
SQLite doesn't have a 'type' for 'date/time' - in MVD, dates and times are actually already stored as text and are then converted by the in-built date / time functions of SQLite at run-time.
What you actually 'see' on screen and what is stored depends on how you have defined it in your data schema.
If you have chosen 'date' in your schema then when you save a record, the date component is stored and the time component defaults to 00:00:000.
If you have chosen 'time' in your schema then when you save a record, the time component is stored and the date component defaults to 1899-12-30 (which is SQLite's minimum date)
If you have chosen 'date/time' in your schema then when you save a record, both the date and the time components are saved.
Have a look at the attached example and the screen shot showing how the SQLite date/time field type is stored.
Derek.

Hello Frank,

Avoiding the use of a button? I'd like to display the output straight from clicking the "MUSICIANS" menu if possible.

A simple way to 'avoid' the use of a button is to actually still use a button with either the 'search' or the 'sqlquery' function but then hide it. 
Then use the 'incremental search' function (see screen shot in the attachment).  This is a 'no script' option.
Derek.

Salut Jean,
With the program that I use to catalogue my CDs, I don't bother with CD cover images or to capture the lyrics (too much like hard work smile).
But just out of interest, I made a version with CD covers and lyrics just to see how it could be done (I don't use 'treeview' very much and some of the differences between it and the usual tablegrid approach are quite interesting and I need the practice!).
I was trying to do everything without any buttons (a combination of interactive tablegrids, treeview and right-click actions but had to admit defeat with saving the images so there is still one button)!!
Anyway, I've attached it and maybe it helps.
Regards,
Derek.

Hi,
There are many ways to do this - which is best depends on what is most suited to your project.
In the attachment are 3 options.
Option1:  simply type in the name
Option2:  click on a name in the tablegrid
Option3:  select the name from the combobox.
As a general comment, it's not usually a good idea to hold someone's 'age' in a table - it is usually better to store their date of birth and then calculate their age when your program runs.
Derek.

Hi Jean,
The project I posted for user FrankLabre had a few bits taken out to simplify the script so he could see just the things that related to his questions.
If you're going to use it (or some amended version of it), here is the version with some of the functions added back in (colour coding / bold font of nodes and adding counts for the number of tracks on each CD).
Unfortunately, in the script I had to hard-code the checks for the 'parentid' (I should have reset the sequence number back to zero before I started but forgot - my bad!!  sad).
Good Luck - 500 CDs is a lot!!
Derek.

Hi Frank, Jean, TCoton,
I couldn't find any examples on the Forum of a 'treeview' project that does everything on the same form (that you were asking about a couple of days ago) so I knocked up a quick example to show you how it could work (it uses a combination of 'treeview' and 'editable tablegrid').  I'm sure there must be other approaches you could take as well - MVD is pretty flexible.
With the 'editable grid', simple type any changes 'in situ' to data that is already there and to add a new row, use the input line at the very top of the 'editable grid' and then press enter to save.
Obviously if it was a 'real' application, you'd want to put some error checking etc in place but it's just for demo purposes so I wanted to keep it relatively 'code free'.
Hope this helps,
Derek.

Hi,
In one of the user guides, there are some references to 'treeview' but it's along the lines of 'this is what it is' rather than how to create a project using it..  I've always found it better to use this Forum's search function, look at the various posts and download projects that are of interest and use them as a guide (but I guess we all 'learn' differently).
Wit regard to using separate forms, 'standard' MVD takes the approach of one form to list the data (which can also be used for 'searches') and a second form for data maintenance.  However, it is possible to use the same form for both functions if you write a small script.
On a more general note, I should point out that MVD is no longer under active development and support for the software is solely via this Forum.  But if you submit detailed questions that are accompanied, if possible, by a project that illustrates the problem, you will almost always get a speedy response;  questions along the lines of the  "....I can't see my data.  What's wrong?' variety tend to, understandably, not get much of a response - big_smile
Regards,
Derek.

Hi,
The problem is that 'Persona' does things (and appears very good) in a way that obviously play to its strengths and so MVD (and any other piece of software) will almost inevitably not compare as favourably. 
It also means that you run the risk of ignoring the strengths of MVD by only trying to mirror the way that 'Persona' works and not considering different approaches where MVD might be more suited.
So having said that, in principle, much of what you are asking about can be done in MVD using 'treeviews'.
However, my personal opinion is that 'treeview' functionality has some limitations (you can't easily drag and drop nodes, you can't by default re-sort nodes etc/  It can be done but just not 'out of the box' and you would need to write script.
My advice would be to mock up a small scale project in MVD using 'treeviews' and see exactly where you think it might come up short.  Then post back to the Forum (attaching your project) and contributors might be able to suggest not only how to overcome any 'treeview' specific problems you may have encountered but also suggest wholly different approaches (linked tablegrids comes immediately to mind) that might be more suitable to MVD.
Regards,
Derek.

75

(4 replies, posted in General)

Salut Jean,
Attached is an old project that I made a couple of changes to and wondered if it might give you some ideas.
Basically,
1.  you tick whichever records you want to purge using the tablegrid check-box.
2.  tick the 'filter' check-box (as a way to confirm you are happy with your selections)
3a.  if you are not happy, just untick the 'filter' check-box and start again.
3b.  if you are happy, click the 'purge' button - this copies the selected records to a spreadsheet and then deletes them from the table.
I appreciate you wanted something that wrote to a text file but perhaps you can just modify this (or maybe writing to a spreadsheet is okay).
Another way might be to simply 'logically delete' checked records with a 'flag' (which always gives you the luxury of retrieving something that you might have deleted in error).  This would probably be my preferred option but obviously I don't know what your exact requirements are in this instance.
Anyway, hope it helps a bit.
Regards,
Derek.