1

Topic: Insertions of a line in the table with values from lable

I want through  to make an insertion of a line in the table

ADOQuery1.Close;
ADOQuery1.SQL.Clear;
ADOQuery1.SQL.Add (' INSERT INTO Bla  )
ADOQuery1.Active: = True;

But the data will undertake from Edit
How it can be made?

2

Re: Insertions of a line in the table with values from lable

evgenii9586 wrote:

As it can be made?

Through parameter. Or as usual - collecting request on the fly (lines can be added).

3

Re: Insertions of a line in the table with values from lable

Through query parameters.
INSERT INTO XXX Values (:ID:Name:Caption)
After request filling to fulfill prepare. There will be parameters.
In them to transfer on a name or under number.
Query1.ParamByName (' Caption ').value: = Label1.caption;

4

Re: Insertions of a line in the table with values from lable

Thanks, I will try

5

Re: Insertions of a line in the table with values from lable

ADOQuery1.Active: = True;
//to replace on
ADOQuery1.Execute

6

Re: Insertions of a line in the table with values from lable

DimaBr wrote:

ADOQuery1.Active: = True;
//to replace on
ADOQuery1.Execute

So does not work

7

Re: Insertions of a line in the table with values from lable

LSV wrote:

Through query parameters.
INSERT INTO XXX Values (:ID:Name:Caption)
After request filling to fulfill prepare. There will be parameters.
In them to transfer on a name or under number.
Query1.ParamByName (' Caption ').value: = Label1.caption;

And I not absolutely understood you. Here there is table Users. Has 4 fields id_user, name_user, adress_user, phone_user
On the form 4 . I need to add a line with parameters entered with

8

Re: Insertions of a line in the table with values from lable

[spoiler]

Form4.ShowModal;
dmSQL.ADOQuery1.Close;
dmSQL.ADOQuery1.SQL.Clear;
dmSQL.ADOQuery1.SQL.ADD (' INSERT INTO Sms_Receivers (id_user, user_name, user_position, user_phone) Values (:ID:Name:Position:Phone); ');

[/spoiler]
Now as that it is possible to transfer parameters

9

Re: Insertions of a line in the table with values from lable

evgenii9586 wrote:

[spoiler]

Form4.ShowModal;
dmSQL.ADOQuery1.Close;
dmSQL.ADOQuery1.SQL.Clear;
dmSQL.ADOQuery1.SQL.ADD (' INSERT INTO Sms_Receivers (id_user, user_name, user_position, user_phone) Values (:ID:Name:Position:Phone); ');

[/spoiler]
Now as that it is possible to transfer parameters

So above already wrote... ParamByName (. Not?

10

Re: Insertions of a line in the table with values from lable

All made