Grid syncronizing with dbf

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

User avatar
mol
Posts: 3817
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Contact:

Re: Grid syncronizing with dbf

Post by mol »

I'm using virtual grid mostly in my last app. It works very quickly, especially with LetoDBF for serving data.
mlnr
Posts: 129
Joined: Fri Aug 28, 2015 1:52 pm
DBs Used: DBF

Re: Grid syncronizing with dbf

Post by mlnr »

Thank you Serge and Marek,

When did you save the data? After you have finished the work with grid or on the fly?
User avatar
serge_girard
Posts: 3364
Joined: Sun Nov 25, 2012 2:44 pm
DBs Used: 1 MySQL - MariaDB
2 DBF
Location: Belgium
Contact:

Re: Grid syncronizing with dbf

Post by serge_girard »

In my case the data in the grid is compared against the database and if a change is allowed then the change is made to the database.
Serge
There's nothing you can do that can't be done...
User avatar
mol
Posts: 3817
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Contact:

Re: Grid syncronizing with dbf

Post by mol »

I never edit data in grid. I don't like it. I'm always building special form to enter/change data. It's more flexible to control if entered values are proper.
User avatar
mol
Posts: 3817
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Contact:

Re: Grid syncronizing with dbf

Post by mol »

I have only one problem with browse - I don't know how to update one selected row after editing it in another form.
Has anyone idea?
Browse.Refresh does it, but causes flickering of screen and take time
franco
Posts: 907
Joined: Sat Nov 02, 2013 5:42 am
DBs Used: DBF
Location: Canada

Re: Grid syncronizing with dbf

Post by franco »

I use temp indexes.....
use table
index on mainitem to temp for something name = 'A' or name = ''T'....... country = 'B' .... invoice = '12345' .... anything in the table
For grid you must keep the record size small.
I agree with Mol. .Edit in another window.
I was looking at editextended in 3.44 . It has a browse window and edit window already made.
All The Best,
Franco
Canada
mlnr
Posts: 129
Joined: Fri Aug 28, 2015 1:52 pm
DBs Used: DBF

Re: Grid syncronizing with dbf

Post by mlnr »

Ok, i see.
I know this is the hardest way but i have to edit the data in the grid and modify every changes in the DBF as well.
Thank you guys.
User avatar
serge_girard
Posts: 3364
Joined: Sun Nov 25, 2012 2:44 pm
DBs Used: 1 MySQL - MariaDB
2 DBF
Location: Belgium
Contact:

Re: Grid syncronizing with dbf

Post by serge_girard »

Gabor,

The above way will give you opportunity to reject changes if not OK!

Serge
There's nothing you can do that can't be done...
User avatar
AUGE_OHR
Posts: 2108
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany

Re: Grid syncronizing with dbf

Post by AUGE_OHR »

hi,

have found a Demo to use a "virtual DBF" instead of Array for "virtual GRID"
c:\hmg.3.4.4\SAMPLES\Advanced\MEMORY_TABLES\demo.prg

have not work with it yet but it seems a interessing Way to avoid "real temporary" DBF.

---

as long you work exclusiv on DBF you can use Browse / Grid in "Edit-Mode" ... but for Network you need "locking".
when using BROWSESYNC ON it will sync navigation with DBF ... make much Traffic ...

when using SQL you don´t have "direct link" to Database ... you "just" get a Result-Set to fill a Array ... or "virtuial DBF"
also think about "write-back". using Cell-Edit is just 1 x Field so you have to lock/un-lock often ...
under SQL same will send many INSERT() Statment ... :roll:

so i do VALID when User press OK and if something wrong i setFocus to that Control and display Tooltip.
when all VALID are OK i "send" all "changed Field" new Value to Server ... for DBF just 1 x Lock / Un-lock
have fun
Jimmy
Post Reply