Really posting data, what method? 
Author Message
 Really posting data, what method?

Can someone tell the differences between these pieces of code????
--differences marked with {!}--

{0--------------------}
Table.Open;
Table.Edit; {do editing}

{A--------------------}
Table.Open;
Table.Edit; {do editing}
Table.Post; {!}

{B-------------------}
Table.Open;
Table.Edit; {do editing}
Table.Post;
Table.Close;{!}

{C-------------------}
Table.Open
Table.Edit; {do editing}
Table.Post;
Check(dbiSaveChanges(Table.Handle));{!}

{D-------------------}
Table.Open
Table.Edit; {do editing}
Table.Post;
Check(dbiSaveChanges(Table.Handle));
Table.Close;{!}

--
C U
[-]
W S



Wed, 18 Jun 1902 08:00:00 GMT  
 Really posting data, what method?
Option {C} is my favourite

{0} - locks the row in the table but does not post to database

{A} -  posts to database ( BDE cache ) but is not guaranteed to flush  all
data to the hard disk
        ( for Paradox or desktop databases with multiple users )

{B} -  posts to database ( BDE cache ) , closes the table , but is not
guaranteed to flush  all data to the hard disk      ( for Paradox or desktop
databases with multiple users )

{C} -  posts to database  , flushes  all data to the hard disk  ( for all
desktop databases)

{D} -  posts to database  , flushes  all data to the hard disk  ( for all
desktop databases) , then (unnecessarily) closes the table

Quote:

>Can someone tell the differences between these pieces of code????
>--differences marked with {!}--

>{0--------------------}
>Table.Open;
>Table.Edit; {do editing}

>{A--------------------}
>Table.Open;
>Table.Edit; {do editing}
>Table.Post; {!}

>{B-------------------}
>Table.Open;
>Table.Edit; {do editing}
>Table.Post;
>Table.Close;{!}

>{C-------------------}
>Table.Open
>Table.Edit; {do editing}
>Table.Post;
>Check(dbiSaveChanges(Table.Handle));{!}

>{D-------------------}
>Table.Open
>Table.Edit; {do editing}
>Table.Post;
>Check(dbiSaveChanges(Table.Handle));
>Table.Close;{!}

>--
>C U
>[-]
>W S



Wed, 18 Jun 1902 08:00:00 GMT  
 Really posting data, what method?
Quote:
>{0--------------------}
>Table.Open;
>Table.Edit; {do editing}

This will allow you to open and edit data.  If you are not using CachedUpdates
then if you change records a Post will automatically happen.

Quote:

>{A--------------------}
>Table.Open;
>Table.Edit; {do editing}
>Table.Post; {!}

Doing this will do an explicit post of the record that was changed.  The
difference from "0" is that you can stay on the same record and it will Post it
to your table.  If you use CachedUpdates, post will only push the data into the
cache and mark it as being edited.  You then need to call UpdateRecord to push
it into the table.
Quote:

>{B-------------------}
>Table.Open;
>Table.Edit; {do editing}
>Table.Post;
>Table.Close;{!}

Will do pretty much the same as A except that now your table is closed and you
won't be able to view the records (if that is what you are doing).  It releases
any lock that you may have on the table as well.

Quote:
>{C-------------------}
>Table.Open
>Table.Edit; {do editing}
>Table.Post;
>Check(dbiSaveChanges(Table.Handle));{!}

The only difference here is if you have created a TempTable with
DbiCreateTempTable.  This operation will make the Table permanent on the disk.
If your table is a current table residing on your disk already,  it will have
the changes posted to it with your "Post" command.

Quote:
>{D-------------------}
>Table.Open
>Table.Edit; {do editing}
>Table.Post;
>Check(dbiSaveChanges(Table.Handle));
>Table.Close;{!}

See above.

********************************
Michael Glatz              


There are very few personal problems that cannot be solved through a suitable
application of high explosives.



Wed, 18 Jun 1902 08:00:00 GMT  
 Really posting data, what method?

Quote:

>{C-------------------}
>Table.Open
>Table.Edit; {do editing}
>Table.Post;
>Check(dbiSaveChanges(Table.Handle));{!}

This is the best option.

What I tend to do is assign the AfterPost event of each table to one
'generic' handler:

    procedure TDM.AfterPosting(DataSet: TDataSet);
    begin
        dbiSaveChanges(DataSet.handle);
    end;

Stephen Brown



Wed, 18 Jun 1902 08:00:00 GMT  
 Really posting data, what method?
TBDEDataSet.FlushBuffers ?

--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
...Should we shout ? Should we Scream ?    ...With all the best wishes - Arioch /BDV/
   What happenned to the post-War dream ?     Buroff - the only and unique...



Wed, 18 Jun 1902 08:00:00 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. someone please post a turbo pasc4 compatible graphmode file thats really cool

2. Abort Method in Before Post Event

3. ExecSQL method and Before Post event: incompatibility ?

4. Whats up with Post method?

5. Paradox Post Method problem

6. Pdox vs Dbase post method

7. help a realy really really new person at pascal

8. * WINDOWS 95 REALLY REALLY Dangerous ???!! *

9. ForEach and traversal methods in OOP data structures

10. ForEach and traversal methods in OOP data structures

11. Partial Post of data

12. Posting data - help

 

 
Powered by phpBB® Forum Software