【发布时间】:2015-04-10 18:28:21
【问题描述】:
在下面的代码 sn-p 中,使用 Sessions 对象为 TQuery 分配了一个 DatabaseName。 您能否建议我们如何在 fireDAC 中进行以下操作或类似操作?
TmpQuery := TQuery.Create(nil);
try
with TmpQuery do
begin
SessionName := Sessions.CurrentSession.SessionName;
DatabaseName := Sessions.CurrentSession.Databases[0].DatabaseName;
SQL.Add('select tendr_type, tendr_code');
SQL.Add('from asatendr where tendr_status="A" ');
Open;
while not EOF do
begin // do the name value pair so i can find them...
FaTenderList.Add(Trim(Fields[0].AsString) + '=' + Trim(Fields[1].AsString));
Next;
end;
Close;
在firedac 中,我们有TFDManager、TFDConnection、TFDQuery 对象。我只想知道不同 .pas 文件中的多个 TFDQueries 如何访问类似的连接。这是如何在 fireDAC 中管理的?
【问题讨论】:
-
SessionName 在 FireDAC 中不存在。带有 DatabaseName 的行应替换为: ConnectionName := FDManager.Connections[0].ConnectionName;
标签: delphi informix delphi-xe5 firedac