Topic: Movie Oscars database

Hello to everyone ...

I am quite new to the Forum and I have recently used MVD I would like to create a database of movie Oscars for myself I managed to import a base of about 3000 records from a CSV file
I created 2 tables: Oscars and Category

I need help on two things:

1. I do not know how to do ProgressBar, which will count my records after pressing the button as on the attached screen?

2. I do not know how to combine the two tables so that the Category fields in the Category table correspond to the Category fields in the OScars table and can be used to enter data using the ComboBox field?


Please help
Attach my base and screenshot in the attachment

I greet everyone cordially

Post's attachments

Attachment icon Oscars.rar 847.68 kb, 142 downloads since 2019-05-27 

Re: Movie Oscars database

Hello.


Unfortunately you use pirate version of My Visual Database. Our support works only for legal users.

Dmitry.

Re: Movie Oscars database

Hello ... I do not use the pirated version of only the Shareware version
here screen

Post's attachments

Attachment icon screen3.jpg 77.27 kb, 86 downloads since 2019-05-27 

Re: Movie Oscars database

It's pirate version.

Dmitry.

Re: Movie Oscars database

OK ...
I did not know about it, now I understand ...
I downloaded the latest version from your website and installed it again ...
I understand that I can not count on your help anyway?
Greetings

Post's attachments

Attachment icon screen4.jpg 77.65 kb, 91 downloads since 2019-05-27 

Re: Movie Oscars database

1. What is purpose of ProgressBar in your case? Also you are already can see count of record in the TableGrid in the footer.
2. Unfortunately your database structure is not correct.


database structure should be
http://myvisualdatabase.com/forum/misc.php?action=pun_attachment&item=5491&download=0



Please check out my book for beginners
http://myvisualdatabase.com/forum/viewtopic.php?id=2694

Post's attachments

Attachment icon oscar.png 12.1 kb, 57 downloads since 2019-05-27 

Dmitry.

Re: Movie Oscars database

I made some changes in your project, now you can edit category using ComboBox, but as I said before, it's not correct database structure.

Post's attachments

Attachment icon Oscars_fixed.zip 630.01 kb, 84 downloads since 2019-05-27 

Dmitry.

Re: Movie Oscars database

Hello Dimitri,

Thank you very much for your help and understanding.

I really care about using ProgressBar.I'm trying to use a ProgressBar, which shows the progress of loading a database, which is in the local assets folder and display basic statistics: eg

1.the number of all films in the database,
2. number of nominees,
3. number of categories,
4. number of films that winner

I know I can count of record in the TableGrid in the footer.But I already did it.

I also changed the structure of the database according to your instructions. I do not know how to use existing data now so that I do not have to enter all data from the beginning.

Thank you for linking to your book. I use it all the time but there is no information on how to do ProgressBar.

Please, if you can help me, I will be very grateful.

Yours faithfully, Darek

Post's attachments

Attachment icon Oscars — newstrukture.rar 739.12 kb, 66 downloads since 2019-05-27 

9 (edited by derek 2019-05-27 23:32:22)

Re: Movie Oscars database

Hi Darek,
I had a look at your CSV file (obviously a flat file) and extracted the data into 3 related tables (films, nominations, categories).  I then took an old project and used it for your 'Film Oscars' application just to give you an idea of the sort of things that MVD can do (you don't even need a script - I just use it to automate a couple of the actions).
You can search for a film,  'click' on it to see any nominations and also search for nominees etc etc.  Most of the information I think you want to get using a status bar, I obtain using calculated fields - there are always different ways to do things with MVD.
The labels and headings are in english (sorry) but they're easy enough to change if you want to use any of the attached program.
Hope this gives you some ideas,
Derek.

Post's attachments

Attachment icon oscars2.zip 513.19 kb, 77 downloads since 2019-05-28 

Re: Movie Oscars database

Hello derek ..

I am very grateful for your help and guidance You can see that you are an MVD expert :-)
I'm just starting my adventure with databases but I am a movie fan and would like to have such a database of Oscar nominees quite privately.

Many of your solutions are just right for me. In connection with your advice, I have several questions:

1. How did you change in the Winner - * field to Yes / No?
2. How did you split the database?
3. Unfortunately, the character field has changed in the Title field and I have strange bushes?
4. How to do at the start of ProgressBar, which will convert all records in the database, read them and show general statistics:

a.the number of all films in the database,
b. number of nominees,
c. number of categories,
d. number of films that winner

as on the attached screen

I care a lot about that ... for many reasons

Post's attachments

Attachment icon screen5.jpg 94.55 kb, 50 downloads since 2019-05-28 

Re: Movie Oscars database

Hello Darek

To fill a panel with Global statistics (I replaced  illustration of the Oscar by a panel and labels to display the values you want to see) and I modified
your first procedure as ;

procedure Form1_OnShow (Sender: string; TObject: string; Action: string);
Var lab5, lab7, lab9, lab11 : String;
begin
  form1.button7.click;
  form1.tablegrid1.SelectedRow:= 0;
  lab5 := IntToStr (SQLExecute('SELECT count(id) FROM films') );
  Form1.Label5.Caption:= Lab5;
  lab7 := IntToStr (SQLExecute('SELECT count(id) FROM nominations') );
  Form1.Label7.Caption:= Lab7;
  lab9 := IntToStr (SQLExecute('SELECT count(id) FROM categories') );
  Form1.Label9.Caption:= Lab9;
  lab11 := IntToStr (SQLExecute('SELECT count(id) FROM nominations where winner <> 0 ') );
  Form1.Label11.Caption:= Lab9;
end;

Is this what you want ?

JB

Re: Movie Oscars database

Hello Darek,
1.  If a field can only have 'yes' or 'no' (or optionally 'neither' as its value, you can choose to define it in your data structure as 'boolean';  use a 'checkbox' on your form and this then shows in tablegrids as 'yes' or 'no'.
2.  I put your CSV into a spreadsheet and -
  a) got unique values for categories and gave each value a sequence number (key) - this became the 'categories' table
  b) got unique values for film title / year and gave each value a sequence number (key) - this became the 'films' table
  c) added the relevant keys (id_films and id_categories) to the nominations - this became the 'nominations' table
I used a utility called SQLiteStudio (it's free) to do the initial data load (you can use MVD import routines (probably the 'correct' way to do it!) but I find it just as quick this way).
I've changed the way the number of nominations for each film and the winners for each film is processed - using calculated fields was slowing it down a bit.
I have added a (temporary) button on Form1 (see attached) called 'Raw Data' - it shows you how all the data is stored in the 3 tables in your database.  It might help you to understand how MVD (and all relational database products) works.  You can just delete the button and associated form when you don't need it any more.
Look at the screenshot in the attachment and see how the data is linked together - for example, '2001 A Space Odyssey' has an ID of 18 - then look at the nominations table in the id_films column with a key of 18 and you'll see the 4 nominations.  Look at the id_category column and follow each of the 4 keys to the 'category' table to see which category it relates to etc, etc. 
Of course, MVD does all this for you automatically but I think it helps if you understand the basic principles behind it.
Regards,
Derek.

Post's attachments

Attachment icon oscars3.zip 1.15 mb, 63 downloads since 2019-05-28 

Re: Movie Oscars database

Hi JB,
Sorry - I didn't see that you'd already replied to Darek.  But I think we're both suggesting something similar.
Regards,
Derek.

Re: Movie Oscars database

Hello everyone, very warmly ...

Thank you for help jean.brezhonek and derek without your help my base oskars would have limited functionality ... thank you again and send tribute ... you explained to me many issues ...

I guess that maybe I expect too much from you :-( but I really want to use the ProgressBar function in the database ...

I would like to see how this function works ???
If it's not a problem then please show me how to use it in my database oskars, for example to load data from a database file or to export or import data to a file or report

I will be very grateful for your understanding and understanding ...

I really care about it :-(

Regards Darek

Re: Movie Oscars database

Why you want to use ProgressBar? you have local database and loading of data will be no more that 0.5 sec.


Unfortunately there is no way to use ProgressBar when you use button with action "Search" but you can use progressbar for other operations when you doing it using script.


Here you can find, how to create and use ProgressBar
http://myvisualdatabase.com/forum/viewtopic.php?id=538

Dmitry.

Re: Movie Oscars database

Hello Dmitri...

Thank you for the next hint and example sent.
As for ProgressBar, as I said, I would like to know the possibilities of this tool on the example of my database. I just do not know how to run ProgressBar in my project. I like this tool visually, but I do not know how to use it. Thank you once again and best regards
you used it.

Thank you once again and best regards

Re: Movie Oscars database

Welcome ...

It's just me again.

How to correctly import a larger amount of data into my base structure from one sheet in this form? I do not know if after the normal import the links between the data will not change?

just like on the screen

Please help .

Regards Darek

Post's attachments

Attachment icon screen6.jpg 333.78 kb, 22 downloads since 2019-05-29 

Re: Movie Oscars database

darek.dorozinski wrote:

Welcome ...

It's just me again.

How to correctly import a larger amount of data into my base structure from one sheet in this form? I do not know if after the normal import the links between the data will not change?

just like on the screen

Please help .

Regards Darek

Unfortunately there is no simple answer.


You should write pretty complex for beginner a import script to do this, I can help you only with specific question.


In the latest beta version I have added a new class TCSV which allow work with CSV files more easy for import data.
https://www.dropbox.com/s/to42wv53pdc0g … a.zip?dl=0


Example, how to use TCSV class

Post's attachments

Attachment icon CSV class.zip 5.3 kb, 63 downloads since 2019-05-29 

Dmitry.

Re: Movie Oscars database

Hello Dimitri.

Thank you for the answer, the beta version and the TCSV class ...
I try to import Gy own data master into the database myself.
If I fail, I will ask you for help.

Greetings

20 (edited by darek.dorozinski 2019-05-31 06:45:50)

Re: Movie Oscars database

Hello ...

Unfortunately, despite many attempts, I can not import all data to my Oscar database.
I prepared the Oscarsfull.csv file (in the attachment) and I would like to import the data from it into my database.
I am asking for help and a brief instruction on how to do it.
I would like to understand how to import data into a ready database structure with related fields and keys.

Best wishes,
darek.dorozinski

Post's attachments

Attachment icon Oscarfull.csv 126.25 kb, 156 downloads since 2019-05-31 

21 (edited by derek 2019-05-31 00:13:12)

Re: Movie Oscars database

Hi Darek,
Attached is your project with the oscarsfull.csv data loaded (loaded the same way as described in my earlier post).
Regards,
Derek.

Post's attachments

Attachment icon oscars4.zip 737.04 kb, 64 downloads since 2019-05-31 

Re: Movie Oscars database

Hey ... derek ...

I'm very grateful for your help.
I have learned a lot from you.
I value your professionalism and willingness to help others very much.

Thank you again and best regards
Darek

23 (edited by derek 2019-05-31 16:16:49)

Re: Movie Oscars database

Hi Darek,
I had a bit of time so I added a couple of things to your project that may be useful.
1.  Now you can enter a nominee in the 'Nominee' search box (for example  'John Wayne' and select a film from the Nominations tablegrid (for example 'True Grit') and this will select films called 'True Grit' into the Films tablegrid.  Then click on 'True Grit' in the Films tablegrid to see ALL of the nominations for that film in the Nominations tablegrid .......  So now it is easier to go back and forth between the two tablegrids.
2.  Click on the 'Oscar' image to link to the academyawards website.
3.  Click on the 'Tomato' image to link to www.rottentomatoes.com website for film reviews (it finds most of them).
Hope this helps to give you ideas for your project and some of the things that MVD is able to do.
Derek.

Post's attachments

Attachment icon oscars4.zip 842.13 kb, 92 downloads since 2019-05-31 

24 (edited by ehwagner 2019-06-03 02:23:29)

Re: Movie Oscars database

Darek,
I read through your posts and you were looking to do a manual import with a progressbar. I put together such a project so you can see how to import and utilize the progressbar using MVD's latest TCSV class script (You need the latest MVD beta version). I used Derek's latest project OSCARS4(Thanks Derek) as the basis for my project. If the import is a one time thing then you should by all means use Derek's solution. Doing the import in an MVD script for multiple tables with multiple relationships can be a little slow and complex, but you can see how it can be done.


I downloaded your Oscarfull,csv from the forum, however, it contained a lot of empty records (thousands). I'm not sure how Derek was able to load the entire file unless you gave him a separate file outside of the forum. Anyway I removed the empty records from the Oscarfull.csv file in order to test the project. I have included the partial file in the project folder so you can test the import for yourself.


Edited - Added the ability to interrupt the import process by pressing the ESC key.

Post's attachments

Attachment icon oscars with csv import by script.zip 868.75 kb, 80 downloads since 2019-06-03 

Re: Movie Oscars database

Hello everyone ...

At the beginning I would like to thank you very much for the import of my entire base of Oscars. Your tips are not appreciated for me. You have taught me a lot. The academyawards website links are very interesting.

Thank you again for helping derek :-)))

A huge thank you also for you ehwagner :-)))
Your import script with progress bar is exactly what I really cared about !!!!!!!

I am full of admiration and appreciation. I am just trying to analyze your script using the latest TCSV class. This is amazing.

Now I see the power and capabilities of MVD.
I am only lucky enough to use the import of data for my database from the "imdb.com" portal or rottentomatoes.com !!!
I would like to be able to import / download and insert a movie poster into the base, e.g. as on the attached screenshot.
Does MVD give this opportunity ???
If so, how can you do it?
Thank you in advance for your time and help

Greetings
Darek

Post's attachments

Attachment icon screen7.jpg 187.3 kb, 71 downloads since 2019-06-03