Topic: error text

Hi Team

the table grid error text. pls see picture in rar file.

Post's attachments

Attachment icon 1inventory.rar 355.57 kb, 226 downloads since 2020-03-04 

Re: error text

chanthait wrote:

Hi Team

the table grid error text. pls see picture in rar file.

See attached

Post's attachments

Attachment icon 1inventory_fixed.zip 9.71 kb, 245 downloads since 2020-03-04 

@thezimguy

Re: error text

In the search button, you were referring to id_vender and id_department. These are just foreign keys and are integers. The main data is in the department and vender table so you need to reference them instead.

@thezimguy

Re: error text

Hi Team

very thanks

Re: error text

Hi Team

how to put symbo $ in table grid.

Post's attachments

Attachment icon dollas.JPG 86.42 kb, 122 downloads since 2020-03-04 

Re: error text

chanthait wrote:

Hi Team

how to put symbo $ in table grid.

http://myvisualdatabase.com/forum/misc.php?action=pun_attachment&item=6308&download=0

Post's attachments

Attachment icon price.png 25.96 kb, 122 downloads since 2020-03-04 

Dmitry.

Re: error text

Thanks for your help.

Re: error text

Hi Team

How to backup database everyday.Thanks

Post's attachments

Attachment icon backupDB.JPG 107.29 kb, 123 downloads since 2020-03-05 

Re: error text

Hello Chantait

You can save your database everytime you open your project (first operation)

var     Timer      : TTimer;
          IsSecond : Integer;

procedure Form1_OnShow (Sender: string; Action: string);
begin
     CopyFile('sqlite.db', 'backup/backup '+ FormatDateTime('dd-mm-yyyy hh-nn-ss', now)+'.db');

     Timer := TTimer.Create (Form1);
     Timer.Interval := 1000;
     Timer.Enabled := True;
     Timer.OnTimer := @OnTimer;
end;

procedure OnTimer;
begin
     iSeconds := iSeconds + 1;
     if iSeconds > 10800 then // backup every 3 hours (10800 seconds)
     begin
          iSeconds := 0;
          CopyFile('sqlite.db', 'backup/backup '+ FormatDateTime('dd-mm-yyyy hh-nn-ss', now)+'.db');
     end;
end;

You can do it everytime you close your project :

procedure Form1_OnClose (Sender: string; Action: string);
begin
     CopyFile('sqlite.db', 'backup/backup '+ FormatDateTime('dd-mm-yyyy hh-nn-ss', now)+'.db');
     Timer.Free;
end;


or more simply : :

procedure Form1_OnClose (Sender: TObject; Action: string);     // sauvegarde d'un seul fichier (sqlite.db)
var vpath: string;
begin
  vpath := extractfiledir(application.exename)+'.bu.db';
  copyfile('sqlite.db',vpath);
end;

Or save it at regular intervals :

at regular intervals

var
   Timer: TTimer;
   iSeconds: integer;

procedure Form1_OnShow (Sender: string; Action: string);      //   A l'ouverture
begin
     CopyFile('sqlite.db', 'backup/backup '+ FormatDateTime('dd-mm-yyyy hh-nn-ss', now)+'.db');

     Timer := TTimer.Create (Form1);
     Timer.Interval := 1000;
     Timer.Enabled := True;
     Timer.OnTimer := @OnTimer;
end;

procedure Form1_OnClose (Sender: string; Action: string);    // Sauvegarde automatique à la sortie
begin
     CopyFile('sqlite.db', 'backup/backup '+ FormatDateTime('dd-mm-yyyy hh-nn-ss', now)+'.db');
     Timer.Free;
end;


procedure OnTimer;     // Ici la sauvegarde se fera toutes les 3 heures
begin
     iSeconds := iSeconds + 1;
     if iSeconds > 10800 then // backup every 3 hours (10800 seconds)
     begin
          iSeconds := 0;
          CopyFile('sqlite.db', 'backup/backup '+ FormatDateTime('dd-mm-yyyy hh-nn-ss', now)+'.db');
     end;
end;


begin
end.


Hope this can help you

JB