7,176

(0 replies, posted in FAQ)

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


procedure Form1_GridEmployees_OnChange (Sender: string);
var
   iRow ,c: integer;
   q, iCol: integer;
begin
     c := Form1.GridEmployees.RowCount - 1;
     q := Form1.GridEmployees.Columns.Count-1;
     for iRow := 0 to c do
         for iCol := 0 to q do
         begin
             if iRow mod 2 = 0 then Form1.GridEmployees.Cell[iCol,iRow].Color := clBtnFace;
         end;
end;

begin
end.


Download project:
http://myvisualdatabase.com/forum/misc. … download=1

7,177

(0 replies, posted in FAQ)

An example with many-to-many relationships in database


A database of authors and their books. The author can have many books, the book may be a few authors.


Download project:
http://myvisualdatabase.com/forum/misc. … download=1

7,178

(0 replies, posted in FAQ)

You can make the settings for your program, so that it can start automatically when you start Windows.


procedure Form1_OnShow (Sender: string; Action: string);
var
   reg: TRegistry;
begin
     reg := TRegistry.Create;
     reg.Access := KEY_ALL_ACCESS;
     reg.RootKey := HKEY_CURRENT_USER;
     reg.OpenKey('software\Microsoft\Windows\CurrentVersion\Run',true);

     Form1.CheckBox1.Checked := reg.ValueExists('MyProjectMVD');

     reg.CloseKey;
     reg.Free;
end;

procedure Form1_OnClose (Sender: string; Action: string);
var
   reg: TRegistry;
begin
     reg := TRegistry.Create;
     reg.Access := KEY_ALL_ACCESS;
     reg.RootKey := HKEY_CURRENT_USER;
     reg.OpenKey('software\Microsoft\Windows\CurrentVersion\Run',true);

     if Form1.CheckBox1.Checked then
         reg.WriteString('MyProjectMVD', '"'+Application.ExeName+'"')
     else reg.DeleteValue('MyProjectMVD');

     reg.CloseKey;
     reg.Free;
end;


begin
end.


Download project:
http://myvisualdatabase.com/forum/misc. … download=1

Display an image in a report when using the LinkFile (mode of component DBImage)
When the image file is not stored in the database, stored on a computer disk.


Download project:
http://myvisualdatabase.com/forum/misc. … download=1

7,180

(0 replies, posted in FAQ)

Project example how to prevent editing other user's records, but the administrator has the right to edit all records and create new users.


Download project:
http://myvisualdatabase.com/forum/misc. … download=1

7,181

(0 replies, posted in FAQ)

Linked list (Country > Region > City) using ComboBoxes.


Download project:
http://myvisualdatabase.com/forum/misc. … download=1

Change the color of the cell component TableGrid, depending on its content.


procedure Form1_GridEmployees_OnChange (Sender: string);
var
   i,c: integer;
begin
     c := Form1.GridEmployees.RowCount - 1;
     for i := 0 to c do
     begin
         if Form1.GridEmployees.Cells[3,i] = 'Yes' then Form1.GridEmployees.Cell[3,i].Color := clRed
             else Form1.GridEmployees.Cell[3,i].Color := clGreen;
     end;
end;

begin

end.

Download project:
http://myvisualdatabase.com/forum/misc. … download=1

7,183

(0 replies, posted in FAQ)

Create duplicate record.


The project with an example of how to make a duplicate record, selected the record in TableGrid, and how to make a duplicate on edit form.


Download project:
http://myvisualdatabase.com/forum/misc. … download=1

Login with username/password with different rights


Download project:
http://myvisualdatabase.com/forum/misc. … download=1



Same project, but user can change own password (SQLite):
http://myvisualdatabase.com/forum/misc. … download=1


Same project, but user can change own password (MySQL):
http://myvisualdatabase.com/forum/misc. … download=1

View an image from the database next to TableGrid


procedure Form1_GridEmployees_OnCellClick (Sender: string; ACol, ARow: Integer);
begin
     Form1.DBImage1.Clear;
     Form1.DBImage1.LoadFromDatabase('employees', 'photo', Form1.GridEmployees.dbItemID);
end;

begin
end.

Download project:
http://myvisualdatabase.com/forum/misc. … download=1

7,186

(0 replies, posted in FAQ)

Logging database editing


An example of a logging database editing
http://myvisualdatabase.com/forum/misc. … download=1


An example of a logging database editing (added Windows user name)
http://myvisualdatabase.com/forum/misc. … download=1

7,187

(2 replies, posted in FAQ)

Create a shortcut key on the example of Shift + Ctrl + P


procedure Form1_OnKeyDown (Sender: string; var Key: Word; Shift, Alt, Ctrl: boolean);
begin
     if (Key = ORD('P')) and Shift and Ctrl then
     begin
          ShowMessage('Shift + Ctrl + P');
     end;
end;


begin
     Form1.KeyPreview := True;
end.


Download project:
http://myvisualdatabase.com/forum/misc. … download=1

7,188

(2 replies, posted in FAQ)

Sending SMS, using service http://clickatell.com/



Download project:
http://myvisualdatabase.com/forum/misc. … download=1

7,189

(0 replies, posted in FAQ)

Sorting column n1-n2-n3


For example:
3-34-1
3-34-2
..........
3-34-10
............
3-36-1


In the settings of TableGrid1 (or button configuration using the "Search"), choose to sort ORDER BY and paste the following condition:

CAST (trim(substr(replace(fieldnumber, '-', '     '), 1, 3)) AS INTEGER), CAST (trim(substr(replace(fieldnumber, '-', '     '), 7, 5)) AS INTEGER), CAST (trim(substr(replace(fieldnumber, '-', '     '), 12)) AS INTEGER)

where fieldnumber - text field type

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



Download project:
http://myvisualdatabase.com/forum/misc. … download=1

7,190

(0 replies, posted in FAQ)

Calculating on the form (frmZakaz)


Let's say there are text fields that contain the product price (edCost) and amount (edQ), you must calculate the Total (edTotal).

procedure CalculateTotal;
begin
    frmZakaz.edTotal.Value := frmZakaz.edCost.Value * frmZakaz.edQ.Value; // calculate
end;

procedure frmZakaz_edQ_OnChange (Sender: string);
begin
    CalculateTotal;
end;

procedure frmZakaz_edCost_OnChange (Sender: string);
begin
    CalculateTotal;
end;


begin

end.


Download project:
http://myvisualdatabase.com/forum/misc. … download=1

я лишь немного изменил формы, структурных ошибок в БД нет.

7,192

(187 replies, posted in General)

tcoton wrote:

Would it be possible to add a TextHint property to TextBox objects so we would not need to script it?

Planned.

tcoton wrote:

Encrypt the Script.dcu as a binary so it would be more difficult to hack the script?

Yes.

tcoton wrote:

Great, this does nearly what I want to do, when you try to read the data using an external tool, the data are not readable; this is what I call preventing read from external source.

The problem is that the encryption password is in clear text in the script file.... big_smile

Is there any chance to encrypt the script file as well in a future version? This would prevent unauthorized people to modify the application as well.


You can remove file script.pas from folder Script, project will use file script.dcu
Also, if you know password, you don't know algorytm without script.pas


tcoton wrote:

Next step would be to write a script to check if a user is allowed to open the application or not as follow:

Allowed users stored in encrypted Table "MVDB_users"

open application --> check users in "MVDB_users" using sUserName := '"'+GetUserName+'"';


- if user exists = Application open                                                                                                                                         

- if user does not exist= display warning then Close application


Is it possible?

Yes, the example for you.

7,194

(6 replies, posted in General)

jean.brezhonek
Planned )

7,195

(30 replies, posted in Russian)

Добавил скрипт, считает сколько оплачено и долг при выборе необходимого ордера.

Приветствую,


Готово, также исправил некоторые ошибки.

7,197

(2 replies, posted in Russian)

Приветствую,


в качестве скриптов используются команды и синтаксис языка ObjectPascal, который применяется в среде программирования Delphi, соответственно можете использовать любые статьи и книги о Delphi.


здесь есть небольшое введение
http://www.snkey.net/books/delphi/ch1-3.html

7,198

(6 replies, posted in General)

Hello,


Please, download latest beta version:
https://www.dropbox.com/s/s1roiqthyx7hx … 2.zip?dl=0



Example for you

aserg wrote:

Жаль, данная прога очень удобна. Не подскажите в чем можно реализовать мой проект?

Видимо вы меня не совсем верно поняли )
Я имел ввиду, что вы не приложили свой проект к сообщению, чтобы я смог помочь вам.

7,200

(6 replies, posted in Script)

tcoton
I have not received the project from you.