Recent

Author Topic: [IT WORKED AROUND]Are not TBufDataset and TDBGrid good friends?  (Read 12402 times)

hrayon

  • Full Member
  • ***
  • Posts: 118
[IT WORKED AROUND]Are not TBufDataset and TDBGrid good friends?
« on: February 21, 2017, 01:03:17 pm »
See it:

Code: Pascal  [Select][+][-]
  1. procedure TForm1.FormShow(Sender: TObject);
  2. var
  3.   l_integer_aux : integer;
  4. begin
  5.   BufDataset1.CreateDataSet;
  6.   BufDataset1ID1.ReadOnly:=false;
  7.  
  8.   BufDataset1.Open;
  9.   BufDataset1.DisableControls;
  10.  
  11.   for l_integer_aux := 1 to 20 do
  12.   begin
  13.     BufDataset1.Append;
  14.     BufDataset1ID1.AsInteger:=l_integer_aux;
  15.     BufDataset1.Post;
  16.   end;
  17.  
  18.   BufDataset1ID1.ReadOnly:=true;
  19.   BufDataset1.EnableControls;
  20. end;

After bottom border resizing, some values are replicated.
The projet is attached too.
Is there some workaround? I'd like to keep both working together.

Typhon 6
FPC 3.1.1
Win 10 64 bits.

Also tested with 32 bit Vista and the problem persists.
« Last Edit: February 22, 2017, 11:41:00 am by hrayon »

Thaddy

  • Hero Member
  • *****
  • Posts: 14201
  • Probably until I exterminate Putin.
Re: Are not TBufDataset and TDBGrid good friends?
« Reply #1 on: February 21, 2017, 01:11:35 pm »
Code: Pascal  [Select][+][-]
  1.   BufDataset1.Open;
  2.   BufDataset1.DisableControls;
  3. /// hmmm. try this:
  4.   BufDataset1.DisableControls;
  5.   BufDataset1.Open;
  6.  
I would also suggest try/finally btw. But that is another matter.
I tested with trunk from today on arm-linux: no issues.

Note that i think you think you are using trunk, but CodeThyphon is unsupported and lags big-time with the real trunk.
CodeTyphon is OK, mind you ((for some), but CodeTypon's "trunk" isn't trunk. And in principle it is not supported on this forum.
Because it causes confusion with the real deal. And because they don't document AT ALL what's in their releases and based on what.

I would recommend a CodeTyphon release based on FPC stable and NOT use their "trunk".
If you are an advanced user, use the real trunk.

(CodeTyphon is hard to get rid off, even on my birthday, today  ::) I wish they had more sense, then it would be even good!)


« Last Edit: February 21, 2017, 01:24:41 pm by Thaddy »
Specialize a type, not a var.

hrayon

  • Full Member
  • ***
  • Posts: 118
Re: Are not TBufDataset and TDBGrid good friends?
« Reply #2 on: February 21, 2017, 01:39:02 pm »
Thank you Thaddy.
After reading your comment, I made the change in the code, and the error persists.
I also installed Lazarus 1.6.2 (lazarus-1.6.2-fpc-3.0.0-win64.exe) from SourceForge.
But ... the error still persists.

Thaddy

  • Hero Member
  • *****
  • Posts: 14201
  • Probably until I exterminate Putin.
Re: Are not TBufDataset and TDBGrid good friends?
« Reply #3 on: February 21, 2017, 02:00:31 pm »
There have been a good many changes to TBufDataset in trunk and most of them have been back-ported to 3.0.2 which I used. Not 3.0.0.
But I guess there can also be an issue just with the TDbGrid in Laz 1.6.2... I was using LazTrunk (1.7) from today.
Do not install that (1.7) if you do not need it, but do install the official FPC 3.0.2.

Maybe Lacak can help out if he reads this... or one of the Laz developers?
Specialize a type, not a var.

hrayon

  • Full Member
  • ***
  • Posts: 118
Re: Are not TBufDataset and TDBGrid good friends?
« Reply #4 on: February 21, 2017, 02:08:01 pm »
I'm confused when I see the code of the components, without a documentation in the code I'm lost ... does the hack that exists in the DBGrid code that signals the binary search for the case of BufDataSet has to do with this? Search for the word "TBufDataset" in the code "dbgrids.pas" and see.

I can get the informed versions with fpcupdeluxe, right? I'll try.

hrayon

  • Full Member
  • ***
  • Posts: 118
Re: Are not TBufDataset and TDBGrid good friends?
« Reply #5 on: February 21, 2017, 02:25:43 pm »
While checkout is being done ...
I do not know if I understand you very well, but is it your birthday today? If I'm right, happy birthday! And for your number of posts, I and many of us must thank you!
(sorry my english)

Thaddy

  • Hero Member
  • *****
  • Posts: 14201
  • Probably until I exterminate Putin.
Re: Are not TBufDataset and TDBGrid good friends?
« Reply #6 on: February 21, 2017, 02:43:27 pm »
tnx   :) 59... Number of posts doesn't count, about 20% was useful and accurate. About 5% without offending people by accident  :o
« Last Edit: February 21, 2017, 02:48:46 pm by Thaddy »
Specialize a type, not a var.

hrayon

  • Full Member
  • ***
  • Posts: 118
Re: Are not TBufDataset and TDBGrid good friends?
« Reply #7 on: February 21, 2017, 03:48:57 pm »
Bad news... Laz 1.6.2 and FPC 3.0.2: problem persists  :(
When trying Laz 1.7 got error in fpcupdeluxe.

It will be good if someone else can test if the problem persists in other environments. The problem only appears if there are records covered by the bottom edge of the form. If you do not see the problem, try to "shake" the edge of the bottom form when you're resizing it. Maximizing the window does not show the problem even if the scroll bar is used. Only if the window is resized (bottom) with the mouse.

I used CodeTyphon just because it was easier to get started with several components installed, and I agree that what they do with licensing is weird. I also hope they improve that part, I do not feel safe using it in that regard. I am waiting for the completion of the "Online Package Manager", looks promising. If it were integrated with Lazarus, along with fpcupdeluxe, it would be even better! It's always good to click less and write less to get things working.

Number of posts do count. Thank you again!

jacmoe

  • Full Member
  • ***
  • Posts: 249
    • Jacmoe's Cyber SoapBox
Re: Are not TBufDataset and TDBGrid good friends?
« Reply #8 on: February 21, 2017, 03:53:45 pm »
Could you try Fpcupdeluxe with the "Fixes" button?
It will give you 1.6.3/3.0.3.

And, you can install the Online Package Manager.

Simply run
Code: Pascal  [Select][+][-]
  1. svn co http://svn.freepascal.org/svn/lazarus/trunk/components/onlinepackagemanager onlinepackagemanager
in the fpcupdeluxe/lazarus/components directory - see the OPM thread topic - I managed to do that for 'Fixes'.
« Last Edit: February 21, 2017, 03:56:55 pm by jacmoe »
more signal - less noise

howardpc

  • Hero Member
  • *****
  • Posts: 4144
Re: Are not TBufDataset and TDBGrid good friends?
« Reply #9 on: February 21, 2017, 04:06:19 pm »
Bad news... Laz 1.6.2 and FPC 3.0.2: problem persists  :(

It will be good if someone else can test if the problem persists in other environments.

On Linux with 1.6.2/3.0.0 there is no display problem at all when resizing. So it must be a Windows bug affecting TDBGrid.

hrayon

  • Full Member
  • ***
  • Posts: 118
Re: Are not TBufDataset and TDBGrid good friends?
« Reply #10 on: February 21, 2017, 04:38:59 pm »
Hi jacmoe, I followed your instructions to update, but  the problem with TDBGrid and TBufDataset persists.

I think the howard pc is right, I just wish someone else using windows could check it out. If the problem does exist, I'll see how to register it in the bug list and try something else.


balazsszekely

  • Guest
Re: Are not TBufDataset and TDBGrid good friends?
« Reply #11 on: February 21, 2017, 05:10:36 pm »
No issues on win7/Lazarus Trunk/FPC 3.0.0. I can resize it all day long, no records are duplicated.

wp

  • Hero Member
  • *****
  • Posts: 11854
Re: Are not TBufDataset and TDBGrid good friends?
« Reply #12 on: February 21, 2017, 05:18:17 pm »
hrayon. you must post a small project which shows the issue. Otherwise this is only wild guessing here, even code fragments are useless because the bug often is somewhere else.

SunyD

  • Guest
Re: Are not TBufDataset and TDBGrid good friends?
« Reply #13 on: February 21, 2017, 05:31:26 pm »
I created bug report for this.
http://bugs.freepascal.org/view.php?id=31375

jacmoe

  • Full Member
  • ***
  • Posts: 249
    • Jacmoe's Cyber SoapBox
Re: Are not TBufDataset and TDBGrid good friends?
« Reply #14 on: February 21, 2017, 05:38:40 pm »
Your bug report will have better chances if you supply a minimal project that reproduces the issue.
more signal - less noise

 

TinyPortal © 2005-2018