Lazarus

Programming => Packages and Libraries => Ported from Delphi/Kylix => Topic started by: talorigomat on November 02, 2004, 11:10:21 am

Title: UIB - Inactive Dataset
Post by: talorigomat on November 02, 2004, 11:10:21 am
I'm using Lazarus version 0.92 beta dated the 4/10/2004 with fpc version 1.9.5 dated 4/10/2004.

Although I've tried opening the dataset before connecting the datasource I still get the 'Operation Can't be performed on an inactive dataset' Error Message.

Below is the procedure I'm using:

procedure TForm1.Button1Click(Sender: TObject);
begin
db.connected:= true;
trn.database :=db;
dst.database := db;
dst.transaction := trn;
dst.sql.text :='select * from organisation';
dst.open;
dsr.dataset := dst;
end;
Title: Re: UIB - Inactive Dataset
Post by: jesusr on November 03, 2004, 06:38:48 am
Quote from: "talorigomat"
I'm using Lazarus version 0.92 beta dated the 4/10/2004 with fpc version 1.9.5 dated 4/10/2004.

Although I've tried opening the dataset before connecting the datasource I still get the 'Operation Can't be performed on an inactive dataset' Error Message.

Below is the procedure I'm using:

procedure TForm1.Button1Click(Sender: TObject);
begin
db.connected:= true;
trn.database :=db;
dst.database := db;
dst.transaction := trn;
dst.sql.text :='select * from organisation';
dst.open;
dsr.dataset := dst;
end;


This might be a problem in the current tdataset code, I reported to the maintainer about this and he sent me a patch which worked well. Probably the patch will be available in cvs soon. By the way, I sent a private message to you about this in the uib forum,

There is a chance that this is actually another problem, so please try to make the following change in jvuibdataset.pas:

Code: [Select]

function TJvUIBCustomDataSet.GetFieldData(Field: TField;
  Buffer: Pointer): Boolean;
begin
  //CheckActive;  // comment this line
  Result := GetFieldData(Field.FieldNo, Buffer);
end;


Compile the component, and build your app. Please, report if this is not case.
Title: UIB - Inactive Dataset
Post by: Anonymous on November 03, 2004, 09:36:26 am
Thanks Jesus.  Commenting the line indicated worked.  Just picked up the message you sent to my  e-mail.  I'll check the CVS as well.
TinyPortal © 2005-2018