Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Delphi ADO: necessary to clean up parameters?

Tags:

delphi

ado

Suppose I have a TADOQuery object that I reuse for different purposes in my program. Do I need to explicitly clean up the parameters when I'm done? Or does that happen automagically when I clear the SQL? e.g.

  adoGenericQuery.SQL.Text := '';
  adoGenericQuery.Parameters.Clear; // <- Is this redundant?
like image 223
wades Avatar asked Feb 26 '23 05:02

wades


1 Answers

You don't need to clear the parameters manually. When the SQL text is assigned, first the query is closed if it is active, then the parameters are either initialized (if ParamCheck is true and the text is not empty) or cleared (if the text is empty).

like image 137
Sertac Akyuz Avatar answered Feb 27 '23 18:02

Sertac Akyuz