Recent

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

lainz

  • Hero Member
  • *****
  • Posts: 4014
  • Leandro Diaz
TBufDataset.IsEmpty what is that?
« on: December 21, 2020, 04:23:00 pm »
Hi, what is the meaning and utility of TBufDataset.IsEmpty method?
https://lainz.github.io/ - My Website :)
https://lazpaint.github.io/ -  Download LazPaint

lainz

  • Hero Member
  • *****
  • Posts: 4014
  • Leandro Diaz
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 »
https://lainz.github.io/ - My Website :)
https://lazpaint.github.io/ -  Download LazPaint

cdbc

  • Sr. Member
  • ****
  • Posts: 354
    • 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 ;)

lainz

  • Hero Member
  • *****
  • Posts: 4014
  • Leandro Diaz
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.
https://lainz.github.io/ - My Website :)
https://lazpaint.github.io/ -  Download LazPaint

lainz

  • Hero Member
  • *****
  • Posts: 4014
  • Leandro Diaz
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
https://lainz.github.io/ - My Website :)
https://lazpaint.github.io/ -  Download LazPaint

 

TinyPortal © 2005-2018