qry_temp的conection指向ADOConnection1,ADOConnection1的connectionstring类似与 Provider=MSDAORA.1;Password=...;User ID=...;Data Source=... with dm.qry_temp do begin close; sql.Clear; sql.Add('SELECT DISTINCT DWMC00 FROM GSTGSGL0 WHERE DWDM00='''+compcode+''''); prepared; open; end;
use query to execute sql,not use connection to do this.
adodataset1.commandText:="sql"
Provider=MSDAORA.1;Password=...;User ID=...;Data Source=...
with dm.qry_temp do
begin
close;
sql.Clear;
sql.Add('SELECT DISTINCT DWMC00 FROM GSTGSGL0 WHERE DWDM00='''+compcode+'''');
prepared;
open;
end;