251

(8 replies, posted in General)

blackpearl8534,

MultiSelect printing is what I gave you. You select multiple rows in the tablegrid, then click on your MutiSelect Print button which takes you to the Name form to change the name in the selected rows. Then you click on the Print button in the Name form which prints the selected rows with the name change applied. If that's not what you want, then what am I missing? Maybe you could explain a little more in detail.

252

(8 replies, posted in General)

I must say this seems to be a strange request, but if I understand what you want then see attached for a solution.

253

(7 replies, posted in General)

Dimitry and Derek,
I downloaded the project and it is working fine on my end. No whiteout. See attached.

I use Astrum Installer and yes it is free. No trial, no watermark. Actually I use the combination of Enigma Virtual Box (to hide folders and files) and the Astrum Installer to install projects on end users computers. It is fairly easy to use. You can create simple installs or you can get as complex as you need. There are wizards to help get you started. You can update registry keys if you need. There are embedded actions which you can perform during or after installs. It can also create uninstalls to be delivered to end users.



There are two types of installs, an original install (which would include an empty database) and an update install which you can setup to upgrade your end users software without touching the database. If you need to update your end users database because there are new fields, then you can do what I do is write an MVD program (with SQL ALTERS) and include that project as a subfolder to the main app folder in the upgrade install. You can then instruct Astrum installer to run that database upgrade and immediately afterwards delete it from the end users system. They don't even know that it even ran. All this can be done with virtually no interaction from the end user other than running the install and click on the NEXT buttons which there are very few. It's pretty fast too.



DBK - Hope this helps.

255

(2 replies, posted in General)

Here is an example of trapping an SQL system message and presenting your own message:


function OnSQLException(Sender: TObject; Msg: string; SQL: string): boolean;
begin
    // exception from button Form1.Button1
    if Sender = Form1.Button1 then
    begin
        if Pos('FOREIGN KEY constraint failed', Msg)=1 then
        begin
            result := True; // to prevent system message
            MessageBox('Your customized message here', 'Error', MB_OK+MB_ICONERROR);
        end;
    end;
end;

Another way to do it is to check, through script, the existence of child records before you attempt the delete of the parent. And if they exist then present your own message.

256

(4 replies, posted in Script)

Hedan,

In your case just change the line Show.ComboBox1.ItemIndex := 1;  to Show.ComboBox1.dbItemID := Form1.ComboBox1.dbItemID;


Not sure how your project is suppose to work, but you could do the search on your first form instead of the Show form.

257

(6 replies, posted in General)

Attached is an example.

258

(1 replies, posted in Script)

See attached for an example.

259

(59 replies, posted in Database applications)

Darek,
I put in BeginSQLiteTransaction and CommitSQLiteTransaction to improve the speed. Basically it does the work in memory and then writes to disk after finishing. While we are on the subject of the import, once you have performed the import once why would you need to do it over again? I don't know what the source of your CSV file is, but it seems to me that there would not be a need to import again until the next Oscar Awards and then you would only want to import the new records. Or the other option would be to use your add and update capability within your project to put in the new records.


This brings up the other issue in your list and that is the backup process. Since your data is basically static till the next Oscars Awards, I think doing backups periodically while the program is open is an overkill. I even think that backing up every time you close the program is an overkill, in my opinion. Unless you are doing updates to it all day long there is no need to do a backup. You would be backing up the same data all the time. I put in code to backup whenever the program closes and you have made changes to your data during the session. I think it's more efficient and you won't have a boat load of backup files that are identical.


I also put in your other statistics. Films with the most nominations, films with the most winners, actors with the most best actor nominations, directors with the most best director nominations. I didn't understand the most Best Pictures. There can only be one Best Picture for a film. Also, keep in mind that the more general statistics you have on your form1, the longer the form may take to load because it's doing a lot of summary processing before showing the numbers..


The last thing you mentioned regarding incorporating other data points for your home collection, etc., I did not do that in the attached project due to my time constraints for right now. I am getting ready to go on vacation. But something to consider if you add fields and update that info through the project, then the full import process will wipe out your manual updates. This is another reason for not doing the full import process after the first time and only import new records when the Oscar Awards occurs the next year.


Hope this helps. Maybe Derek or somebody else can lend a hand from here

260

(59 replies, posted in Database applications)

Darek,
Attached is an updated project with some of the features you were asking. But some of the questions I wasn't clear on.

1) How to make an option to disable or enable a copy of the database using the?  I don't know what you mean by enable and disable a copy of the database. Maybe explain a little more.

2) Splash screen is working as you like.

3) The import is much faster now.

4) I do not believe that MVD_Scraper is able to do what you want. It is designed to extract information from a specific web page. I'm not sure you can actually manipulate or navigate web pages and click buttons or links with MVD. But I'm not an expert on web scraping. Maybe Mathias or Dimitry can enlighten you more on this subject.

5) Tablegrid headers and footers have different colored background (by script). You cannot make the text a different color.

6) Not sure what else you need.

7) MVD maintains the id's and will always be in order.

8) I provided an example of embedding a video on a form. I wasn't sure if you were intending on maintaining video paths for each film. So I just provided a button to open any video file on disk and show the clip.

9) I put in the code for a trial. Form1 caption will show how many days you have left in the trial period. The trial version allows for complete access to all features for 30 days.

10) I created a simple report for you. The report button is under Tablegrid1.

261

(59 replies, posted in Database applications)

Sorry about that Darek. I forgot to include year when retrieving the id of a film. See attached for the fix.

262

(59 replies, posted in Database applications)

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.

263

(6 replies, posted in General)

manixs2013,
Derek mentioned about another option which would be to extract the file list from the image directory into a stringlist. I went ahead and put together such a project. See attached.

Doing it this way, you do not need to rename all images and you do not need to know the number of files in the folder for the random number.

264

(6 replies, posted in General)

manixs2013,
The Random function has recently changed.  Try the following:

vrandompicture := 'images\' + inttostr(random(6)) + '.jpg';

265

(2 replies, posted in General)

Terry,
You can use Filter within the Object Inspector to sort by Type. You can also display the Type along with the Name in the combobox. This is an option and not a requirement.  See attached for a sample solution.

Brian,
How are you filtering? Are you using the SEARCH action or SQL QUERY? If you are using the SEARCH action for filtering then you could try the attached example. It is a little awkward and I have no idea how it will impact the speed of your application with the amount of records you have. But basically you create a hidden tablegrid and Search button with the same search as the visible one. Place the count in the footer of the hidden tablegrid. Then upon execution of the visible search you click (thru script) the hidden search button. Then populate the count label with the footer count in the hidden tablegrid.


If you are using SQL QUERY for filtering, then, as Dimitry pointed out, you will need to use SQL Query to count the filtered records. You should be able to use the same query WHERE clause as the SQL Query used in loading the tablegrid.

267

(7 replies, posted in General)

Yes Derek I agree. Maybe this is something that Dimitry can look into. Even more,  formatting columns without scripting for all the rows in tablegrids.

268

(7 replies, posted in General)

Derek,
Just throwing this out there. In the newer version you can specify the field type for calculated fields. If you let the field type default as text for currency fields, then the formatting does not work as specified in the script. It may not be your situation, but I have picked up on it recently.

269

(11 replies, posted in General)

eyeman303,
You might consider using the Richtext memo field to store the complaints, etc.. That way it's all in one field and you can highlight/colorize important items in the richtext field.

270

(9 replies, posted in General)

Adam,
The reason you were getting the error was because your SELECT was not working properly and the SoundFile variable was empty. A couple of things needed to be considered. If the program is run and the due date and time have already passed, the alerts should be initiated. Also, if you have multiple reminders, you cannot use the form fields to look at the checkboxes for playing the sound and showing a  message because the form is only going to show the last record edited. So you have to store the play sound and show message in each reminder record and then select reminders having the Boolean fields checked. Once a reminder has been initiated, then it is turned off so it does not keep repeating. Hopefully the revised project is closer to what you want or at least gets you headed in the right direction.

271

(29 replies, posted in General)

reteinformatica,
Another option would be to hide the first form rather than trying to close it. It gives the same result.


procedure Form2_OnShow (Sender: TObject; Action: string);
begin
  Form1.Hide;
end;

272

(11 replies, posted in General)

manixs2013,
I went ahead and corrected it for you.

273

(11 replies, posted in General)

procedure Form1_btnDup_OnClick (Sender: TObject; var Cancel: boolean);
begin
    SqlExecute('INSERT INTO Table1 (Field1, Field2, Field3, Field4, Field5) '
      + 'SELECT Field1, Field2, Field3, Field4, Field5 FROM Table1'
      + 'WHERE id = ' + Form1.TableGrid1.sqlValue);
    Form1.TableGrid1.dbUpdate;
end;

274

(6 replies, posted in General)

manixs2013.


It would be nice if MVD was able to embed a user icon. But short of that, what you could do is what I do. Create an MVD project which copies the appropriate user project files from the Development folder to a Distribution/Production folder and during that process you open Resource Hacker automatically so you can't forget to assign an icon. It works for me and I don't ever forget to do it. Just a thought.

275

(4 replies, posted in General)

Not sure if this is what you are looking for, but see attached for a possible solution. When you run the project go to your pumps form and assign a printer to each pump. Then when you click SAVE on Form1, the report for the entered transaction will go to the specified printer for the pump automatically.