Recent

Author Topic: TBufDataset.IsEmpty what is that?  (Read 879 times)

lainz

  • Hero Member
  • *****
  • Posts: 4468
    • https://lainz.github.io/
TBufDataset.IsEmpty what is that?
« on: December 21, 2020, 04:23:00 pm »
Hi, what is the meaning and utility of TBufDataset.IsEmpty method?

lainz

  • Hero Member
  • *****
  • Posts: 4468
    • https://lainz.github.io/
Re: TBufDataset.IsEmpty what is that?
« Reply #1 on: December 21, 2020, 04:26:04 pm »
Because here says:
https://www.freepascal.org/docs-html/current/fcl/db/tdataset.isempty.html

Quote
IsEmpty returns True if the dataset is empty, i.e. if EOF and TDataset.BOF are both True, and the dataset is not in insert mode.

I was using this before saving to SQLite database to check there is data to save in the buf dataset, but it fails sometimes saying it is empty, I removed it and it saves the data in the database anyways, so is strange for me.

Maybe because the data sometimes is in edit mode and not insert mode?
« Last Edit: December 21, 2020, 04:27:48 pm by lainz »

cdbc

  • Hero Member
  • *****
  • Posts: 1083
    • http://www.cdbc.dk
Re: TBufDataset.IsEmpty what is that?
« Reply #2 on: December 21, 2020, 04:36:36 pm »
Hi
You can edit the source yourself, and when it works, submit a patch, just a thought  ;)
Regards Benny
If it ain't broke, don't fix it ;)
PCLinuxOS(rolling release) 64bit -> KDE5 -> FPC 3.2.2 -> Lazarus 2.2.6 up until Jan 2024 from then on it's: KDE5/QT5 -> FPC 3.3.1 -> Lazarus 3.0

lainz

  • Hero Member
  • *****
  • Posts: 4468
    • https://lainz.github.io/
Re: TBufDataset.IsEmpty what is that?
« Reply #3 on: December 21, 2020, 04:39:42 pm »
Hi
You can edit the source yourself, and when it works, submit a patch, just a thought  ;)
Regards Benny

Hi thanks, but I'm not sure for that I'm asking =)

I think I was using it wrong, I don't think it has a bug.

lainz

  • Hero Member
  • *****
  • Posts: 4468
    • https://lainz.github.io/
Re: TBufDataset.IsEmpty what is that?
« Reply #4 on: January 28, 2021, 06:09:34 pm »
Any ideas? This is making trouble with our project.

Something is wrong in the state of the bufdataset isEmpty. I can't reproduce but it happens on our customers machines.

Sometimes is true and sometimes is false, even with the same number of rows > 0

 

TinyPortal © 2005-2018