FireDAC TFDConnection.GetTableNames 在具有可信身份验证的 Firebird 上不起作用



我正在将我的火鸟数据库与FireDAC连接(从FIBPlus迁移并使用XE8更新1)。我使用可信身份验证(osau10th =True)。我需要在数据库中读取表的列表。我正在使用TFDConnection。GetTableNames和它的工作很好与标准身份验证(用户名+密码),但我不能得到它的工作使用可信的身份验证。也许我做错了什么,或者我使用了错误的方法来获取这种信息。这就是我正在做的:

var
  oDef : IFDStanConnectionDef;
  oPars: TFDPhysFBConnectionDefParams;
begin
  oDef:=FDManager.ConnectionDefs.AddConnectionDef;
  oDef.Name:='MyFirebird';
  oPars:=TFDPhysFBConnectionDefParams(oDef.Params);
  oPars.DriverID:='FB';
  oPars.Protocol:=ipTCPIP;
  oPars.Server:=edServer.Text;
  oPars.SQLDialect:=3;
  oPars.Database:=edDataBase.Text;
  oPars.OSAuthent:=(edPassword.Text='');
  oPars.UserName:='SYSDBA';
  oPars.Password:=edPassword.Text;
  oPars.RoleName:=edRole.Text;
  oPars.OpenMode:=omOpen;
  FDPhysFBDriverLink1.Embedded:=False;
  FDPhysFBDriverLink1.VendorLib:='c:MyProgramfbclient.dll';
  FDConnection1.ConnectionDefName:='MyFirebird';
  FDConnection1.Connected:=TRUE;
  FDConnection1.GetTableNames('','','',Memo1.Lines,[osMy],[tkTable]);       '<--- doesn't works with os authentication
  FDQuery1.SQL.Text:='select * from MYTABLE';
  FDQuery1.Active:=TRUE;                                              '<--- works fine in both kind of authentication

The FIBPlus TpFIBDatabase。我要替换的GetTableNames可以很好地用于两种身份验证。

任何想法?

修改命令如下:

FDConnection1.GetTableNames('','','',Memo1.Lines,[osMy],[tkTable],true);

相关内容

最新更新