Forum > Databases

Locate error

(1/1)

mmelwin:
I also put it here because I think the problem is with SQLQuery and not with DbGrid.

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.

Lazarus 2.0.12, FPC 3.2.0, OS Win10, PostgreSQL 13

In demo:
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.

Oryginal post: https://forum.lazarus.freepascal.org/index.php/topic,54966.0.html

Soner:
I tested with lazarus 2.0.11 fpc 3.2.1 both 64 bit and Lazarus 1.8.5 with fpc 3.0.4 32bit on Windows 10.
I could not reproduce the error, from original post too.

Have your computer enough ram? Your program consums 423 MB RAM. Without enough free RAM swapping and locate can take a long time.
For me it looks like speed problem caused by ram on your computer wait at least 1 minute after clicking locate.

Try this, maybe it helps:

--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---DBGrid1.BeginUpdate; try  SQLQuery1.Locate('test', 200000, []); finally  DBGrid1.EndUpdate(false); end; 

mmelwin:
I think I've found the problem. Out of memory.
Everything is fine after compiling to x64.
I just need to find some other solution, because I have several computers with Win XP 32bit :(

Zvoni:
Release/Free Memory you don't need

Navigation

[0] Message Index

Go to full version