Home > Back-end > In different forms of Delphi call adoquery of dm, different forms to execute SQL code
In different forms of Delphi call adoquery of dm, different forms to execute SQL code
Time:09-28
Each great spirit: In different forms of Delphi call adoquery of dm, different forms to perform different SQL code how?
When I was in a closed form, will adoquery. SQL. The clear also useless, it's no use is not active,
When open the display of data or another form of the original form of adoquery SQL code as a result, ask you a great god how should solve?
CodePudding user response:
{dm unit:} With adoquery1 do The begin The close; SQL. Text:='select * from table'; {different function, to use a different SQL statements} The open; The end;
CodePudding user response:
Do not understand, that I how to call in the form? After the execution is primarily a form data don't know how to release, then the next form when the show is about to go wrong,
CodePudding user response:
A form of a query, don't share!!!!!!
CodePudding user response:
Dm can build two procedure calls, such as: Public Procedure TS1. The begin With adoquery1 do The begin The close; SQL. Text:='select * from table1'; The open; The end; The end; Procedure TS2. The begin With adoquery2 do The begin The close; SQL. Text:='select * from table2'; The open; The end; The end;
Forms 1 call TS1, form 2 call TS2, Form show: establish directly form together with the main form of start, closing did not release resources, Form showmodal: dynamic established forms, closing release resources,