Browse / grid /dbf

Topic Specific Tutorials and Tips.

Moderator: Rathinagiri

Post Reply
jpp
Posts: 34
Joined: Thu Jan 16, 2014 3:04 pm

Browse / grid /dbf

Post 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 !
User avatar
mol
Posts: 3720
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Contact:

Re: Browse / grid /dbf

Post 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.
User avatar
gfilatov
Posts: 1067
Joined: Fri Aug 01, 2008 5:42 am
Location: Ukraine
Contact:

Re: Browse / grid /dbf

Post 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
...
Kind Regards,
Grigory Filatov

"Everything should be made as simple as possible, but no simpler." Albert Einstein
User avatar
srvet_claudio
Posts: 2193
Joined: Thu Feb 25, 2010 8:43 pm
Location: Uruguay
Contact:

Re: Browse / grid /dbf

Post 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!!!
Best regards.
Dr. Claudio Soto
(from Uruguay)
http://srvet.blogspot.com
Javier Tovar
Posts: 1275
Joined: Tue Sep 03, 2013 4:22 am
Location: Tecámac, México

Re: Browse / grid /dbf

Post by Javier Tovar »

Hi all,

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

regards
Javier Tovar
Posts: 1275
Joined: Tue Sep 03, 2013 4:22 am
Location: Tecámac, México

Re: Browse / grid /dbf

Post 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
jpp
Posts: 34
Joined: Thu Jan 16, 2014 3:04 pm

Re: Browse / grid /dbf

Post 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 !!!!
User avatar
fchirico
Posts: 324
Joined: Sat Aug 23, 2008 11:27 pm
Location: Argentina

Re: Browse / grid /dbf

Post 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.
Saludos, Fernando Chirico.
jpp
Posts: 34
Joined: Thu Jan 16, 2014 3:04 pm

Re: Browse / grid /dbf

Post 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 !
Post Reply