Page 1 of 1

Browse / grid /dbf

Posted: Wed Feb 12, 2014 9:00 am
by jpp
Hi to All,

I'm working hard on hmg 3.2, reading all doc i've found and samples but now i've some questions without answers ...

I've made a test program with a 40 000 records database with a simple grid with ROWSOURCE DBF, and the same with the "browse" control. With the grid the "loading" of my form is about 15s over the network and 2s with the browse.

I'm 'happy' but ... as i've not found samples with browse in hmg 3.2 i'm a bit affraid that browse will be discarded in newer version !

-> Why browse is faster than grid ? ( I've tried to use VIRTUAL GRID with no succes with a DBF rowsoure )
-> Is there a way to make a grid as fast than browse with a dbf ? ( as grid seems to be the most used control )

thanks to spend a little of ure time to give me some answer or some sample !

Re: Browse / grid /dbf

Posted: Wed Feb 12, 2014 2:00 pm
by mol
I'm still using browse for it's functionality with dbf files.
You can find samples in older versions of HMG. They are still the same.

IMHO, Grid is unusable for dbf files.

Re: Browse / grid /dbf

Posted: Wed Feb 12, 2014 2:40 pm
by gfilatov
jpp wrote:Hi to All,

I'm working hard on hmg 3.2, reading all doc i've found and samples but now i've some questions without answers ...

I've made a test program with a 40 000 records database with a simple grid with ROWSOURCE DBF, and the same with the "browse" control. With the grid the "loading" of my form is about 15s over the network and 2s with the browse.
...
Hi,

IMHO The using of the command COUNT TO in a grid code is reason of this different loading time between Grid and Browse.

Please take a look for the following function in core code:

Code: Select all

Function GetDataGridRecCount()
Local nCount
Local nInitialRecord 

	nInitialRecord := RecNo()

	COUNT TO nCount

	dbGoTo( nInitialRecord )

Return nCount
...

Re: Browse / grid /dbf

Posted: Wed Feb 12, 2014 4:31 pm
by srvet_claudio
gfilatov wrote:
jpp wrote:Hi to All,

I'm working hard on hmg 3.2, reading all doc i've found and samples but now i've some questions without answers ...

I've made a test program with a 40 000 records database with a simple grid with ROWSOURCE DBF, and the same with the "browse" control. With the grid the "loading" of my form is about 15s over the network and 2s with the browse.
...
Hi,

IMHO The using of the command COUNT TO in a grid code is reason of this different loading time between Grid and Browse.

Please take a look for the following function in core code:

Code: Select all

Function GetDataGridRecCount()
Local nCount
Local nInitialRecord 

	nInitialRecord := RecNo()

	COUNT TO nCount

	dbGoTo( nInitialRecord )

Return nCount
...
Hi Grigory.
Many thanks for your tip!!!

Re: Browse / grid /dbf

Posted: Wed Feb 12, 2014 4:39 pm
by Javier Tovar
Hi all,

An example of where Claudio Soto shows that Grid is much faster than Browse, hope to find.

regards

Re: Browse / grid /dbf

Posted: Wed Feb 12, 2014 4:54 pm
by Javier Tovar
Hi all.

Well not if you Browse faster, but if the new Grid is much faster than the last!

Please see this post:

viewtopic.php?f=24&t=3224&p=29330&hilit=gridex" onclick="window.open(this.href);return false; # p29330

regards

Re: Browse / grid /dbf

Posted: Wed Feb 12, 2014 5:44 pm
by jpp
Hi Grigory

lot of thanks for your answer...and bravo for your knowledge of hmg !
I've had a look at h_grid.prg and i have seen that cellnavigation is forced to .t. for a rowsource.
i supposed it's for a good reason but i've not found why !

to come back to "GetDataGridRecCount" why not use lastrec() ? is it for the accuracy of the scroll bar in case of deleted or filter ? is this case it will be nice to bypass that in case of large databases.

cordialement from France !!!!

Re: Browse / grid /dbf

Posted: Thu Feb 13, 2014 2:55 am
by fchirico
jpp wrote:....

to come back to "GetDataGridRecCount" why not use lastrec() ? is it for the accuracy of the scroll bar in case of deleted or filter ? is this case it will be nice to bypass that in case of large databases.

cordialement from France !!!!
IMHO lasterc() give the number of the last record, but not how many records are.

Re: Browse / grid /dbf

Posted: Thu Feb 13, 2014 7:58 am
by jpp
Hi Fernando,

i know that lastrec does not give the number of records...but in the case of GetDataGridRecCount, if "the real count of records" is only for the accuracy of the vscrollbar, it's not very important for me in front of the time saved when loading the grid with a 'big' database ...

bye !