Help - Search - Members - Calendar
Full Version: Configure to use with DBISAM
Fast Reports forum > Fast Reports Products > Open Query Builder
msalinas
What are the steps to configure OPB to work with DBISAM Tables?

Any Information will be appreciated.

Regards.
AlexTZ
You have to write OQB engine for DBISAM. You can use bde, ado or ibx engines code as a sample.

Here is a DBISAM engine code from FastReport powerpack, you may try to use it:

uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, ExtCtrls, DB, DBISAMtb, QBuilder;


type
TfrQBDBIEngine = class(TOQBEngine)
private
FResultQuery: TDBISAMQuery;
public
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
procedure ReadTableList; override;
procedure ReadFieldList(ATableName: string); override;
procedure ClearQuerySQL; override;
procedure SetQuerySQL(Value: string); override;
function ResultQuery: TDataSet; override;
procedure OpenResultQuery; override;
procedure CloseResultQuery; override;
procedure SaveResultQueryData; override;
function SelectDatabase: Boolean; override;
procedure UpdateTableList;
published
property Query: TDBISAMQuery read FResultQuery write FResultQuery;
end;


{ TfrQBDBIEngine }

constructor TfrQBDBIEngine.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
FResultQuery := nil;
end;

destructor TfrQBDBIEngine.Destroy;
begin
CloseResultQuery;
inherited Destroy;
end;

procedure TfrQBDBIEngine.UpdateTableList;
begin
ReadTableList;
end;

function TfrQBDBIEngine.SelectDatabase: Boolean;
begin
Result := False;
end;

procedure TfrQBDBIEngine.ReadTableList;
begin
Session.GetTableNames(DatabaseName, TableList);
end;

procedure TfrQBDBIEngine.ReadFieldList(ATableName: String);
var
i: Integer;
Temp: TDBISAMTable;
begin
Temp := nil;
try
Temp := TDBISAMTable.Create(nil);
Temp.DataBaseName := FResultQuery.DatabaseName;
Temp.TableName := aTableName;

FieldList.Clear;
FieldList.Add('*');
Temp.FieldDefs.Update;
for i := 0 to Temp.FieldDefs.Count - 1 do
FieldList.Add(Temp.FieldDefs.Items[i].Name);
finally
Temp.Close;
Temp.Free;
end;
end;

procedure TfrQBDBIEngine.ClearQuerySQL;
begin
FResultQuery.SQL.Clear;
end;

procedure TfrQBDBIEngine.SetQuerySQL(Value: String);
begin
FResultQuery.SQL.Text := Value;
end;

function TfrQBDBIEngine.ResultQuery: TDataSet;
begin
Result := FResultQuery;
end;

procedure TfrQBDBIEngine.OpenResultQuery;
begin
if not FResultQuery.Prepared then
FResultQuery.Prepare;
FResultQuery.Active := True;
end;

procedure TfrQBDBIEngine.CloseResultQuery;
begin
FResultQuery.Active := False;
end;

procedure TfrQBDBIEngine.SaveResultQueryData;
begin
ShowMessage('Operation non supported.');
end;
msalinas
Alex,

Thanks for your help.... I'll try it.

Regards.
Laryen
Hi All,

I am running with D6.02 and DBISAM 3.27 and for the life of me, I cannot get the engine to work. While it will create the Icon, if I go to delete the engine Icon from the form, I get hit with an AV. Once I hit the AV, delphi will not close. While I feel rather like a fool, Can someone who has it working perhaps enlighten me?

Regards,

Larry
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2012 Invision Power Services, Inc.