Recent

Author Topic: DBGrid error  (Read 1632 times)

mmelwin

  • New Member
  • *
  • Posts: 19
DBGrid error
« on: June 11, 2021, 07:31:36 am »
When I click on DBGrid while running a Locate on SQLQuery, the DBGrid crashes. Can I prevent this somehow? Disable / EnableControls doesn't help. I am attaching two screenshots, before and after Locate.

Handoko

  • Hero Member
  • *****
  • Posts: 4286
  • My goal: build my own game engine using Lazarus
Re: DBGrid error
« Reply #1 on: June 11, 2021, 08:31:17 am »
Only some screenshots does not help much. We need more information. Please provide more information to help us help you.

Version of the software (OS, Lazarus, database, etc) and steps to reproduce the issue. It will be extremely helpful if you can provide the compile-able source code, so we can inspect and debug it on our computer. If you're not willing to publicize the project, you can write a short demo that can let us to reproduce the problem.

You can use the Publish Project feature in the IDE:
Lazarus main menu > Project > Publish project

Or manually select and include the files:
Create a new folder, copy and paste all the necessary files (including the data file) except: the binary (exe file), *.bak, lib and backup folders. Compress the folder and send the zip to the forum.

mmelwin

  • New Member
  • *
  • Posts: 19
Re: DBGrid error
« Reply #2 on: June 11, 2021, 08:41:21 am »
Lazarus 2.0.12, FPC 3.2.0, OS Win10, PostgreSQL 13. I will prepare a demo.

mmelwin

  • New Member
  • *
  • Posts: 19
Re: DBGrid error
« Reply #3 on: June 11, 2021, 10:44:28 am »
Please click "Populate", wait a while, click "Locate" and quickly click in the DBGrid area.

The problem only occurs when the searched field is sorted descending.

For ease of use, the demo uses SQLite.

dseligo

  • Sr. Member
  • ****
  • Posts: 276
Re: DBGrid error
« Reply #4 on: June 11, 2021, 12:20:59 pm »
I tried your example and I can confirm the problem.

I then tried with ZeosDBO components and it works, but maybe because it locates row before I have a chance to click DBGrid.

Test project with ZeosDBO components is attached if you want to try it.

Handoko

  • Hero Member
  • *****
  • Posts: 4286
  • My goal: build my own game engine using Lazarus
Re: DBGrid error
« Reply #5 on: June 11, 2021, 12:30:33 pm »
I tested DEMO.7Z on Ubuntu Mate 20.10 using Lazarus 2.0.10 64-bit, could not reproduce the problem.

mmelwin

  • New Member
  • *
  • Posts: 19
Re: DBGrid error
« Reply #6 on: June 11, 2021, 02:28:15 pm »
I tried your example and I can confirm the problem.

I then tried with ZeosDBO components and it works, but maybe because it locates row before I have a chance to click DBGrid.

Test project with ZeosDBO components is attached if you want to try it.

Didn't you have a chance to click on DBGrid. Locate in Zeos is very fast because it loads the entire query result at once. SQLdb only loads the first few lines.

 

TinyPortal © 2005-2018