Registriert seit: 15. Dez 2002
Ort: Mittelfranken
980 Beiträge
Delphi 10 Seattle Enterprise
|
Re: DataSet und Rave
8. Jan 2007, 13:40
So,
nun habe ich mir mal die BSP von Marco angeschaut und um die Rave-Eigenschaft erweitert;
der GetCols-Bereich ist sicherlich nicht korrekt, aber mti dtStrings ging es am schnellesten <g>
Delphi-Quellcode:
type
TForm1 = class(TForm)
DBGrid1: TDBGrid;
DataSource1: TDataSource;
DirectoryListBox1: TDirectoryListBox;
RvProject1: TRvProject;
Button1: TButton;
RvCustomConnection1: TRvCustomConnection;
procedure FormCreate(Sender: TObject);
procedure DirectoryListBox1Change(Sender: TObject);
procedure Button1Click(Sender: TObject);
procedure RvCustomConnection1GetCols(Connection: TRvCustomConnection);
procedure RvCustomConnection1GetRow(Connection: TRvCustomConnection);
procedure RvCustomConnection1Open(Connection: TRvCustomConnection);
procedure RvCustomConnection1Next(Connection: TRvCustomConnection);
procedure RvCustomConnection1EOF(Connection: TRvCustomConnection;
var Eof: Boolean);
private
{ Private declarations }
public
DirDataset: TDirdataSet;
end;
var
Form1: TForm1;
implementation
.........................................
procedure TForm1.RvCustomConnection1EOF(Connection: TRvCustomConnection;
var Eof: Boolean);
begin
eof := false;
if DirDataset.Eof then
eof := true;
end;
procedure TForm1.RvCustomConnection1GetCols(Connection: TRvCustomConnection);
begin
with Connection do
begin
WriteField('shortFileName', dtString, 50, 'Dateiname',
'aus MarcoCantu-BSP');
WriteField('Time', dtString, 50, 'Zeit', 'aus MarcoCantu-BSP');
WriteField('Size', dtString, 50, 'Groesse', 'aus MarcoCantu-BSP');
WriteField('Attr', dtString, 50, 'Dateiname', 'aus MarcoCantu-BSP');
end;
end;
procedure TForm1.RvCustomConnection1GetRow(Connection: TRvCustomConnection);
begin
with Connection do
begin
WriteStrData('', DirDataset.Fields.FieldByNumber(1).AsString);
WriteStrData('', DirDataset.Fields.FieldByNumber(2).AsString);
WriteStrData('', DirDataset.Fields.FieldByNumber(3).AsString);
WriteStrData('', DirDataset.Fields.FieldByNumber(4).AsString);
end;
end;
procedure TForm1.RvCustomConnection1Next(Connection: TRvCustomConnection);
begin
DirDataset.Next;
end;
procedure TForm1.RvCustomConnection1Open(Connection: TRvCustomConnection);
begin
Connection.DataRows := DirDataset.RecordCount;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
RvProject1.Execute;
end;
In der Zip-Datei noch die RAV; hat bei mir problemlos geklappt <g>
thomas, TeamNevrona
|
|
Zitat
|