unit Unit5;
interface
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, HTMLHelpViewer;
type
TFAddUser = class(TForm)
Edit1: TEdit;
Label1: TLabel;
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
FAddUser: TFAddUser;
implementation
{$R *.dfm}
uses Unit4, Unit2, variable;
procedure TFAddUser.Button1Click(Sender: TObject);
begin
if(Length(Edit1.Text) > 2) then
begin
with FResults.ADOQResult do
begin
SQL.Clear;
SQL.Add('INSERT INTO Respondents (FIO) VALUES ("'+Edit1.Text+'")');
ExecSQL;
ShowMessage('Пользователь добавлен');
FIONew:=edit1.text;
end; Close;
end
else
ShowMessage('Введены неверные данные');
end;
end.
interface
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, HTMLHelpViewer;
type
TFAddUser = class(TForm)
Edit1: TEdit;
Label1: TLabel;
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
FAddUser: TFAddUser;
implementation
{$R *.dfm}
uses Unit4, Unit2, variable;
procedure TFAddUser.Button1Click(Sender: TObject);
begin
if(Length(Edit1.Text) > 2) then
begin
with FResults.ADOQResult do
begin
SQL.Clear;
SQL.Add('INSERT INTO Respondents (FIO) VALUES ("'+Edit1.Text+'")');
ExecSQL;
ShowMessage('Пользователь добавлен');
FIONew:=edit1.text;
end; Close;
end
else
ShowMessage('Введены неверные данные');
end;
end.