我从这里下载了免费的 DBX 驱动程序下载了免费的 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(错误代码 22)。它可能从系统路径中丢失。”
我的应用程序路径中有所需的库,甚至在 System32 路径中也有。我没有使用 dbxdrivers.ini 和 dbxconnections.ini。
那么这里发生了什么?我有带有最新更新的 Delphi 2009。
谢谢你的时间。