我已經從here下載免費的DBX驅動程序。使用免費的DBX驅動程序與TSQLConnection相關的問題
我試圖使它工作兩天以來,沒有成功。
這裏是我的代碼的快照:
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。
那麼這裏發生了什麼?我有德爾福2009年與最新的更新。
謝謝你的時間。
有沒有人有過該組件的成功?我聽過的所有人都是有問題的人。 –
我會首先嚐試使其與* .ini文件一起工作,但在嘗試不包含它們時,我發現太多帖子失敗。 [這是一個](https://forums.embarcadero.com/message.jspa?messageID=20783)這樣的線程。 –
我確實試過ini,相信我......但是謝謝你的提示。我已經決定放棄,我已經使用了devart的商業解決方案(目前正在試用),這種解決方案沒有任何問題。 – Wodzu