Skip to forum content
My Visual Database
A Simple Solution for Creating Databases
You are not logged in. Please login or register.
Active topics Unanswered topics
Search options (Page 288 of 400)
Topics by DriveSoft User defined search
Posts found: 7,176 to 7,200 of 9,999
Striped TableGrid
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
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
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
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
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
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
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
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
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
Download project:
http://myvisualdatabase.com/forum/misc. … download=1
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
я лишь немного изменил формы, структурных ошибок в БД нет.
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....
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.
Добавил скрипт, считает сколько оплачено и долг при выборе необходимого ордера.
Приветствую,
Готово, также исправил некоторые ошибки.
Приветствую,
в качестве скриптов используются команды и синтаксис языка ObjectPascal, который применяется в среде программирования Delphi, соответственно можете использовать любые статьи и книги о Delphi.
здесь есть небольшое введение
http://www.snkey.net/books/delphi/ch1-3.html
Hello,
Please, download latest beta version:
https://www.dropbox.com/s/s1roiqthyx7hx … 2.zip?dl=0
Example for you
aserg wrote:Жаль, данная прога очень удобна. Не подскажите в чем можно реализовать мой проект?
Видимо вы меня не совсем верно поняли )
Я имел ввиду, что вы не приложили свой проект к сообщению, чтобы я смог помочь вам.
tcoton
I have not received the project from you.
Posts found: 7,176 to 7,200 of 9,999