【问题标题】:Problems with using free DBX driver in conjunction with TSQLConnection将免费 DBX 驱动程序与 TSQLConnection 结合使用的问题
【发布时间】:2011-08-10 08:52:30
【问题描述】:

我从here下载了免费的DBX驱动。

我从两天前开始尝试让它工作,但没有成功。

这是我的代码快照:

unit uMainForm;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, SqlExpr, WideStrings, DBXDynalink, DB;

type
  TMainForm = class(TForm)
    Button1: TButton;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  MainForm: TMainForm;

implementation

{$R *.dfm}

procedure TMainForm.Button1Click(Sender: TObject);
var C: TSQLConnection;
begin
  C := TSQLConnection.Create(Self);
  try
    C.DriverName := 'FirebirdConnection';
    C.LibraryName := 'dbxfb4d12.dll';
    C.VendorLib := 'fbclient.dll';
    C.GetDriverFunc := 'getSQLDriverFIREBIRD';
    C.Params.Add('User_Name=SYSDBA');
    C.Params.Add('Password=masterkey');
    C.Params.Add('Database=C:\MyDB.fdb');
    C.Open;
    if C.Connected then
      ShowMessage('Connection is active')
  finally
    C.Free;
  end;
end;

运行测试后,我收到错误:“无法加载 fbclient.dll(ErrorCode 22)。它可能从系统路径中丢失。”

我的应用程序路径中有所需的库,甚至在 System32 路径中也有。我没有使用 dbxdrivers.ini 和 dbxconnections.ini。

那么这里发生了什么?我有最新更新的 Delphi 2009。

感谢您的宝贵时间。

【问题讨论】:

  • 有人用那个组件成功了吗?我只听说过有问题的人。
  • 我会首先尝试使其与 *.ini 文件一起使用,我看到太多帖子在尝试不包含它们时失败。 Here's one 这样的线程。
  • 我确实尝试过使用 ini,相信我...但感谢您的提示。我决定放弃,我使用了 devart 的商业解决方案(目前正在试用中),它没有任何问题。
  • @David - 我确实让它工作了......终于。您无法在 IDE 中连接任何东西……这一切都必须在运行时完成。我更愿意使用让我在 IDE 中构建和查看内容的驱动程序。
  • @cape 周围有很多好司机,所以我不明白这个的吸引力。

标签: delphi database-connection delphi-2009 firebird dbx


【解决方案1】:

您是否也尝试将 fbclient.dll 文件与可执行文件放在同一文件夹中?

【讨论】:

    【解决方案2】:

    有时需要将 fbclient.dll 重命名为 gds32.dll。它可能会成功。

    【讨论】:

      猜你喜欢
      • 2023-03-09
      • 1970-01-01
      • 2012-02-13
      • 1970-01-01
      • 2017-09-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多